From de0d70679b129a9ddf2eb6dc84952aa872b7fbca Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 27 Sep 2022 19:50:54 +0200 Subject: [PATCH] more fixes --- Application/UninstallerAbstract.php | 1 + Auth/Auth.php | 2 +- Math/Parser/Evaluator.php | 4 +++- tests/phpunit_no_coverage.xml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Application/UninstallerAbstract.php b/Application/UninstallerAbstract.php index 865d48800..f6bf790d6 100644 --- a/Application/UninstallerAbstract.php +++ b/Application/UninstallerAbstract.php @@ -94,6 +94,7 @@ abstract class UninstallerAbstract return; // @codeCoverageIgnore } + /** @var array $definitions */ $definitions = \json_decode($content, true); $builder = new SchemaBuilder($dbPool->get('schema')); diff --git a/Auth/Auth.php b/Auth/Auth.php index a0bc22059..e7147507c 100755 --- a/Auth/Auth.php +++ b/Auth/Auth.php @@ -51,7 +51,7 @@ final class Auth { $uid = $session->get('UID'); - return empty($uid) ? 0 : $uid; + return (int) (empty($uid) ? 0 : $uid); } /** diff --git a/Math/Parser/Evaluator.php b/Math/Parser/Evaluator.php index b2e16dccb..2713909fd 100644 --- a/Math/Parser/Evaluator.php +++ b/Math/Parser/Evaluator.php @@ -129,8 +129,10 @@ final class Evaluator while ($o2 !== false && \strpbrk($o2, '^*/+-') !== false && (($operators[$o1]['order'] === -1 && $operators[$o1]['precedence'] <= $operators[$o2]['precedence']) - || ($operators[$o1]['order'] === 1 && $operators[$o1]['precedence'] < $operators[$o2]['precedence'])) + /*|| ($operators[$o1]['order'] === 1 && $operators[$o1]['precedence'] < $operators[$o2]['precedence'])*/) ) { + // The commented part above is always FALSE because this equation always compares 4 < 2|3|4. + // Only uncomment if the opperators array changes. $output[] = \array_pop($stack); $o2 = \end($stack); } diff --git a/tests/phpunit_no_coverage.xml b/tests/phpunit_no_coverage.xml index 1125d51fb..97b4b0f7b 100755 --- a/tests/phpunit_no_coverage.xml +++ b/tests/phpunit_no_coverage.xml @@ -25,7 +25,7 @@ ./vendor ./Build ./Resources - ./Application/Testapp* + ./Application/Testapp*