diff --git a/phpstan.neon b/phpstan.neon index 1b0f571b..b3df0604 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -42,3 +42,12 @@ parameters: - www/lib/smarty-3.1.30/ # ignore composer - www/vendor + # ignore errores with + # ignoreErrors: + #- 'error regex' + #- + # message: 'error regex' + # path: %currentWorkingDirectory%/www/some/* + # paths: + # - ... + # - ... diff --git a/static_checkers.txt b/static_checkers.txt index 893a2a1d..1975c116 100644 --- a/static_checkers.txt +++ b/static_checkers.txt @@ -1,3 +1,9 @@ -phan --progress-bar -C -o analysis.txt +# main static checker +phan --progress-bar -C -o 4dev/tmp/analysis.txt +# sub static checker phpstan analyse -c phpstan.neon --memory-limit=4G -l 0 www +# only if we work with composer only www/: psalm (this needs the composer autoloader defined) + +# for linting +parallel-lint www/ diff --git a/www/lib/CoreLibs/Basic.php b/www/lib/CoreLibs/Basic.php index 623e11b6..ae5d49d0 100644 --- a/www/lib/CoreLibs/Basic.php +++ b/www/lib/CoreLibs/Basic.php @@ -1512,7 +1512,7 @@ class Basic // labels in order of size $labels = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'); // calc file size, round down too two digits, add label based max change - return round($number / pow(1024, ($i = floor(log($number, 1024)))), 2).($space ? ' ' : '').(isset($labels[(int)$i]) ? $labels[(int)$i] : '>EB'); + return round($number / pow(1024, ($i = floor(log((float)$number, 1024)))), 2).($space ? ' ' : '').(isset($labels[(int)$i]) ? $labels[(int)$i] : '>EB'); } return (string)$number; }