strikt types
This commit is contained in:
@@ -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);
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user