GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#5)
by Adrien
07:48
created
src/Algorithms/ShortestPath/Dijkstra.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     
41 41
     public function computePath(Node $source, Node $target)
42 42
     {
43
-        if(! $this->grid instanceof NodeGrid)
43
+        if (!$this->grid instanceof NodeGrid)
44 44
         {
45 45
             throw new \RuntimeException('Invalid Grid');
46 46
         }
@@ -52,20 +52,20 @@  discard block
 block discarded – undo
52 52
         $priorityQueue->insert($source, 0);
53 53
         $distanceMap->insert($source, 0);
54 54
         
55
-        while(! $priorityQueue->isEmpty())
55
+        while (!$priorityQueue->isEmpty())
56 56
         {
57 57
             $node = $priorityQueue->extract();
58 58
             
59
-            if($node->getId() === $target->getId())
59
+            if ($node->getId() === $target->getId())
60 60
             {
61 61
                 return new NodePath($previousMap->lookupFrom($node));
62 62
             }
63 63
             
64 64
             $neighbors = $this->grid->getWalkableNeighbors($node);
65
-            foreach($neighbors as $neighbor)
65
+            foreach ($neighbors as $neighbor)
66 66
             {
67 67
                 $alternativeDistance = $distanceMap->lookup($node) + $this->distance->compute($node, $neighbor);
68
-                if(! $distanceMap->exists($neighbor) || $alternativeDistance < $distanceMap->lookup($neighbor))
68
+                if (!$distanceMap->exists($neighbor) || $alternativeDistance < $distanceMap->lookup($neighbor))
69 69
                 {
70 70
                     $priorityQueue->insert($neighbor, $alternativeDistance);
71 71
                     $distanceMap->insert($neighbor, $alternativeDistance);
Please login to merge, or discard this patch.
src/Algorithms/TravelingSalesman/NearestNeighbour.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,13 +24,13 @@  discard block
 block discarded – undo
24 24
     
25 25
     public function computeRoute()
26 26
     {
27
-        if(! $this->graph instanceof NodeGraph)
27
+        if (!$this->graph instanceof NodeGraph)
28 28
         {
29 29
             throw new \RuntimeException('Invalid Graph');
30 30
         }
31 31
         
32 32
         $vertexes = $this->graph->getVertexes();
33
-        if(count($vertexes) <= 2)
33
+        if (count($vertexes) <= 2)
34 34
         {
35 35
             return new NodePath($vertexes);
36 36
         }
@@ -40,15 +40,15 @@  discard block
 block discarded – undo
40 40
         
41 41
         $pathMap = new NodeMap();
42 42
         $pathMap->insert($vertexFrom, $vertexTo);
43
-        while(! empty($vertexes))
43
+        while (!empty($vertexes))
44 44
         {
45 45
             $minimalVertexTo = null;
46 46
             $minimalEdge = INF;
47 47
             $edges = $this->graph->getEdgesFrom($vertexFrom);
48
-            foreach($edges as $vertexToId => $edge)
48
+            foreach ($edges as $vertexToId => $edge)
49 49
             {
50 50
                 $vertexTo = $this->graph->getVertex($vertexToId);
51
-                if(! $pathMap->exists($vertexTo) && $edge < $minimalEdge)
51
+                if (!$pathMap->exists($vertexTo) && $edge < $minimalEdge)
52 52
                 {
53 53
                     $minimalVertexTo = $vertexTo;
54 54
                     $minimalEdge = $edge;
Please login to merge, or discard this patch.
src/Algorithms/TravelingSalesman/TwoOpt.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -30,15 +30,15 @@  discard block
 block discarded – undo
30 30
     
31 31
     public function computeRoute()
32 32
     {
33
-        if(! $this->graph instanceof NodeGraph)
33
+        if (!$this->graph instanceof NodeGraph)
34 34
         {
35 35
             throw new \RuntimeException('Invalid Graph');
36 36
         }
37
-        if(! $this->existingRoute instanceof NodePath)
37
+        if (!$this->existingRoute instanceof NodePath)
38 38
         {
39 39
             throw new \RuntimeException('Invalid ExistingRoute');
40 40
         }
41
-        if(count($this->existingRoute) < 2)
41
+        if (count($this->existingRoute) < 2)
42 42
         {
43 43
             return $this->existingRoute;
44 44
         }
@@ -48,17 +48,17 @@  discard block
 block discarded – undo
48 48
         do
49 49
         {
50 50
             $improvementMade = false;
51
-            foreach($this->existingRoute->getKeys() as $iKey)
51
+            foreach ($this->existingRoute->getKeys() as $iKey)
52 52
             {
53
-                foreach($this->existingRoute->getKeys() as $kKey)
53
+                foreach ($this->existingRoute->getKeys() as $kKey)
54 54
                 {
55
-                    if($iKey == $kKey)
55
+                    if ($iKey == $kKey)
56 56
                     {
57 57
                         continue;
58 58
                     }
59 59
                     $newRoute = $this->twoOptSwap($iKey, $kKey);
60 60
                     $newDistance = $this->graph->computeLength($newRoute);
61
-                    if($newDistance < $existingDistance)
61
+                    if ($newDistance < $existingDistance)
62 62
                     {
63 63
                         $this->existingRoute = $newRoute;
64 64
                         $existingDistance = $newDistance;
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                     }
69 69
                 }
70 70
             }
71
-        } while($improvementMade);
71
+        } while ($improvementMade);
72 72
         
73 73
         return $this->existingRoute;
74 74
     }
@@ -76,13 +76,13 @@  discard block
 block discarded – undo
76 76
     private function twoOptSwap($iKey, $kKey)
77 77
     {
78 78
         $newRouteNodes = array();
79
-        foreach($this->existingRoute->getKeys() as $key)
79
+        foreach ($this->existingRoute->getKeys() as $key)
80 80
         {
81 81
             if ($key === $iKey)
82 82
             {
83 83
                 $newRouteNodes[] = $this->existingRoute->getKey($kKey);
84 84
             }
85
-            elseif($key === $kKey)
85
+            elseif ($key === $kKey)
86 86
             {
87 87
                 $newRouteNodes[] = $this->existingRoute->getKey($iKey);
88 88
             }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -81,12 +81,10 @@
 block discarded – undo
81 81
             if ($key === $iKey)
82 82
             {
83 83
                 $newRouteNodes[] = $this->existingRoute->getKey($kKey);
84
-            }
85
-            elseif($key === $kKey)
84
+            } elseif($key === $kKey)
86 85
             {
87 86
                 $newRouteNodes[] = $this->existingRoute->getKey($iKey);
88
-            }
89
-            else
87
+            } else
90 88
             {
91 89
                 $newRouteNodes[] = $this->existingRoute->getKey($key);
92 90
             }
Please login to merge, or discard this patch.
src/Algorithms/TravelingSalesman/ThreeOpt.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -30,15 +30,15 @@  discard block
 block discarded – undo
30 30
     
31 31
     public function computeRoute()
32 32
     {
33
-        if(! $this->graph instanceof NodeGraph)
33
+        if (!$this->graph instanceof NodeGraph)
34 34
         {
35 35
             throw new \RuntimeException('Invalid Graph');
36 36
         }
37
-        if(! $this->existingRoute instanceof NodePath)
37
+        if (!$this->existingRoute instanceof NodePath)
38 38
         {
39 39
             throw new \RuntimeException('Invalid ExistingRoute');
40 40
         }
41
-        if(count($this->existingRoute) < 3)
41
+        if (count($this->existingRoute) < 3)
42 42
         {
43 43
             return $this->existingRoute;
44 44
         }
@@ -48,19 +48,19 @@  discard block
 block discarded – undo
48 48
         do
49 49
         {
50 50
             $improvementMade = false;
51
-            foreach($this->existingRoute->getKeys() as $iKey)
51
+            foreach ($this->existingRoute->getKeys() as $iKey)
52 52
             {
53
-                foreach($this->existingRoute->getKeys() as $jKey)
53
+                foreach ($this->existingRoute->getKeys() as $jKey)
54 54
                 {
55
-                    foreach($this->existingRoute->getKeys() as $kKey)
55
+                    foreach ($this->existingRoute->getKeys() as $kKey)
56 56
                     {
57
-                        if($iKey == $jKey || $iKey == $kKey || $jKey == $kKey)
57
+                        if ($iKey == $jKey || $iKey == $kKey || $jKey == $kKey)
58 58
                         {
59 59
                             continue;
60 60
                         }
61 61
                         $newRoute = $this->threeOptSwap($iKey, $jKey, $kKey);
62 62
                         $newDistance = $this->graph->computeLength($newRoute);
63
-                        if($newDistance < $existingDistance)
63
+                        if ($newDistance < $existingDistance)
64 64
                         {
65 65
                             $this->existingRoute = $newRoute;
66 66
                             $existingDistance = $newDistance;
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
                     }
72 72
                 }
73 73
             }
74
-        } while($improvementMade);
74
+        } while ($improvementMade);
75 75
         
76 76
         return $this->existingRoute;
77 77
     }
@@ -79,17 +79,17 @@  discard block
 block discarded – undo
79 79
     private function threeOptSwap($iKey, $jKey, $kKey)
80 80
     {
81 81
         $newRouteNodes = array();
82
-        foreach($this->existingRoute->getKeys() as $key)
82
+        foreach ($this->existingRoute->getKeys() as $key)
83 83
         {
84 84
             if ($key === $iKey)
85 85
             {
86 86
                 $newRouteNodes[] = $this->existingRoute->getKey($kKey);
87 87
             }
88
-            elseif($key === $jKey)
88
+            elseif ($key === $jKey)
89 89
             {
90 90
                 $newRouteNodes[] = $this->existingRoute->getKey($iKey);
91 91
             }
92
-            elseif($key === $kKey)
92
+            elseif ($key === $kKey)
93 93
             {
94 94
                 $newRouteNodes[] = $this->existingRoute->getKey($jKey);
95 95
             }
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -84,16 +84,13 @@
 block discarded – undo
84 84
             if ($key === $iKey)
85 85
             {
86 86
                 $newRouteNodes[] = $this->existingRoute->getKey($kKey);
87
-            }
88
-            elseif($key === $jKey)
87
+            } elseif($key === $jKey)
89 88
             {
90 89
                 $newRouteNodes[] = $this->existingRoute->getKey($iKey);
91
-            }
92
-            elseif($key === $kKey)
90
+            } elseif($key === $kKey)
93 91
             {
94 92
                 $newRouteNodes[] = $this->existingRoute->getKey($jKey);
95
-            }
96
-            else
93
+            } else
97 94
             {
98 95
                 $newRouteNodes[] = $this->existingRoute->getKey($key);
99 96
             }
Please login to merge, or discard this patch.
src/Algorithms/TravelingSalesman/kOpt.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,11 +28,11 @@
 block discarded – undo
28 28
     
29 29
     public function computeRoute()
30 30
     {
31
-        if(! $this->graph instanceof NodeGraph)
31
+        if (!$this->graph instanceof NodeGraph)
32 32
         {
33 33
             throw new \RuntimeException('Invalid Graph');
34 34
         }
35
-        if(! $this->existingRoute instanceof NodePath)
35
+        if (!$this->existingRoute instanceof NodePath)
36 36
         {
37 37
             throw new \RuntimeException('Invalid ExistingRoute');
38 38
         }
Please login to merge, or discard this patch.