strikt types

This commit is contained in:
Troy Grunt
2026-02-15 14:45:02 +01:00
parent a093603c3c
commit cd031464e6
13 changed files with 77 additions and 69 deletions

View File

@@ -1,5 +1,7 @@
<?php
function decade($zahl)
declare(strict_types=1);
function decade(int|float|string $zahl): int|float|string
{
if (! is_numeric($zahl) || $zahl == 0)
return $zahl;
@@ -31,7 +33,7 @@ function decade($zahl)
return $zahl . ' ' . $si[$e];
}
function onlyNumeric($num) {
function onlyNumeric(string $num): string {
return preg_replace("/[^0-9\.\-]+/", "", $num);
}
?>
?>