Test Failed
Push — master ( a0700c...a8eadf )
by Witali
03:18 queued 44s
created
src/Heuristic/Manhattan.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@
 block discarded – undo
9 9
 
10 10
     public function compare(Node $node, Node $goal)
11 11
     {
12
-        $deltaX = abs($node->getX() - $goal->getX());
13
-        $deltaY = abs($node->getY() - $goal->getY());
14
-        return $deltaX + $deltaY;
12
+        $deltaX = abs($node->getX()-$goal->getX());
13
+        $deltaY = abs($node->getY()-$goal->getY());
14
+        return $deltaX+$deltaY;
15 15
     }
16 16
 }
17 17
\ No newline at end of file
Please login to merge, or discard this patch.
src/Heuristic/Euclidean.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@
 block discarded – undo
9 9
     public function compare(Node $node, Node $goal)
10 10
     {
11 11
 
12
-        $deltaX = abs($node->getX() - $goal->getX());
13
-        $deltaY = abs($node->getY() - $goal->getY());
14
-        return sqrt($deltaX * $deltaX + $deltaY * $deltaY);
12
+        $deltaX = abs($node->getX()-$goal->getX());
13
+        $deltaY = abs($node->getY()-$goal->getY());
14
+        return sqrt($deltaX * $deltaX+$deltaY * $deltaY);
15 15
     }
16 16
 }
17 17
\ No newline at end of file
Please login to merge, or discard this patch.
src/Heuristic/Diagonal.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@
 block discarded – undo
9 9
     public function compare(Node $node, Node $goal)
10 10
     {
11 11
 
12
-        $deltaX = abs($node->getX() - $goal->getX());
13
-        $deltaY = abs($node->getY() - $goal->getY());
12
+        $deltaX = abs($node->getX()-$goal->getX());
13
+        $deltaY = abs($node->getY()-$goal->getY());
14 14
         return max($deltaX, $deltaY);
15 15
     }
16 16
 }
17 17
\ No newline at end of file
Please login to merge, or discard this patch.
src/Grid.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -36,16 +36,16 @@
 block discarded – undo
36 36
         $y = $node->getY();
37 37
 
38 38
         $neighbourLocations = [
39
-            [$y - 1, $x],
40
-            [$y + 1, $x],
41
-            [$y, $x - 1],
42
-            [$y, $x + 1]
39
+            [$y-1, $x],
40
+            [$y+1, $x],
41
+            [$y, $x-1],
42
+            [$y, $x+1]
43 43
         ];
44 44
         if ($diagonal) {
45
-            $neighbourLocations[] = [$y - 1, $x - 1];
46
-            $neighbourLocations[] = [$y + 1, $x - 1];
47
-            $neighbourLocations[] = [$y - 1, $x + 1];
48
-            $neighbourLocations[] = [$y + 1, $x + 1];
45
+            $neighbourLocations[] = [$y-1, $x-1];
46
+            $neighbourLocations[] = [$y+1, $x-1];
47
+            $neighbourLocations[] = [$y-1, $x+1];
48
+            $neighbourLocations[] = [$y+1, $x+1];
49 49
         }
50 50
         foreach ($neighbourLocations as $location) {
51 51
             list($y, $x) = $location;
Please login to merge, or discard this patch.
src/Astar.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,14 +73,14 @@
 block discarded – undo
73 73
                 if ($neighbor->isClosed() || in_array($neighbor->getCosts(), $this->blocked)) {
74 74
                     continue;
75 75
                 }
76
-                $score = $current->getScore() + $neighbor->getCosts();
76
+                $score = $current->getScore()+$neighbor->getCosts();
77 77
                 $visited = $neighbor->isVisited();
78 78
                 if (!$visited || $score < $neighbor->getScore()) {
79 79
                     $neighbor->visit();
80 80
                     $neighbor->setParent($current);
81 81
                     $neighbor->setGuessedScore($this->heuristic->compare($neighbor, $end));
82 82
                     $neighbor->setScore($score);
83
-                    $neighbor->setTotalScore($neighbor->getScore() + $neighbor->getGuessedScore());
83
+                    $neighbor->setTotalScore($neighbor->getScore()+$neighbor->getGuessedScore());
84 84
                     if (!$visited) {
85 85
                         $heap->insert($neighbor);
86 86
                     }
Please login to merge, or discard this patch.