diff --git a/DataStorage/Database/Mapper/ReadMapper.php b/DataStorage/Database/Mapper/ReadMapper.php index ca4a3650f..b72052a25 100755 --- a/DataStorage/Database/Mapper/ReadMapper.php +++ b/DataStorage/Database/Mapper/ReadMapper.php @@ -1223,11 +1223,8 @@ final class ReadMapper extends DataMapperAbstract } $objects = $objectMapper->execute(); - if (empty($objects) || $objects === false) { - return false; - } - return true; + return !empty($objects) && $objects !== false; } elseif (isset($this->mapper::OWNS_ONE[$member]) || isset($this->mapper::BELONGS_TO[$member]) ) { diff --git a/Math/Geometry/ConvexHull/GrahamScan.php b/Math/Geometry/ConvexHull/GrahamScan.php index a9f566c69..df65eedd1 100644 --- a/Math/Geometry/ConvexHull/GrahamScan.php +++ b/Math/Geometry/ConvexHull/GrahamScan.php @@ -55,7 +55,9 @@ final class GrahamScan $points = \array_merge([null], $points); for ($i = 2; $i < $count; ++$i) { - if ($points[$i]['y'] < $points[$min]['y'] || ($points[$i]['y'] == $points[$min]['y'] && $points[$i]['x'] < $points[$min]['x'])) { + if ($points[$i]['y'] < $points[$min]['y'] + || ($points[$i]['y'] === $points[$min]['y'] && $points[$i]['x'] < $points[$min]['x']) + ) { $min = $i; } } diff --git a/Math/Optimization/Simplex.php b/Math/Optimization/Simplex.php index 1a46ef507..687e6509a 100644 --- a/Math/Optimization/Simplex.php +++ b/Math/Optimization/Simplex.php @@ -85,11 +85,11 @@ class Simplex $best = -1; for ($j = 0; $j < $this->n; ++$j) { - if ($this->c[$j] > 0) { - if ($best === -1 || $this->Nonbasic[$j] < $ind) { - $ind = $this->Nonbasic[$j]; - $best = $j; - } + if ($this->c[$j] > 0 + && ($best === -1 || $this->Nonbasic[$j] < $ind) + ) { + $ind = $this->Nonbasic[$j]; + $best = $j; } } diff --git a/Stdlib/Tree/BinarySearchTree.php b/Stdlib/Tree/BinarySearchTree.php index 6fb6392b0..4a171d881 100644 --- a/Stdlib/Tree/BinarySearchTree.php +++ b/Stdlib/Tree/BinarySearchTree.php @@ -231,7 +231,7 @@ class BinarySearchTree ) { $node->parent->left = null; } elseif ($node->parent->right !== null - && $node->parent->right->root->compare($node) === 0 + && $node->parent->right->root?->compare($node->data) === 0 ) { $node->parent->right = null; } diff --git a/tests/DataStorage/Database/Query/BuilderTest.php b/tests/DataStorage/Database/Query/BuilderTest.php index fb61096a5..81237c111 100755 --- a/tests/DataStorage/Database/Query/BuilderTest.php +++ b/tests/DataStorage/Database/Query/BuilderTest.php @@ -763,7 +763,7 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase $this->expectException(\InvalidArgumentException::class); $query = new Builder($con, true); - $query->select(false); + $query->select(new class {}); } /**