Passed
Push — master ( f53aaa...debf7f )
by Omar
17:42
created
src/BFS/BreadthFirstPaths.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      */
142 142
     public function hasPathTo(int $vertex)
143 143
     {
144
-         // validate this vertex in the context of the given graph
144
+            // validate this vertex in the context of the given graph
145 145
         Graph::validateVertex($vertex, $this->graph->getVertices());
146 146
         // return the flag
147 147
         return $this->marked[$vertex];
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
      */
154 154
     public function distTo(int $vertex)
155 155
     {
156
-         // validate this vertex in the context of the given graph
156
+            // validate this vertex in the context of the given graph
157 157
         Graph::validateVertex($vertex, $this->graph->getVertices());
158 158
         // return the value
159 159
         return $this->distTo[$vertex];
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
      */
166 166
     public function pathTo(int $vertex)
167 167
     {
168
-         // validate this vertex in the context of the given graph
168
+            // validate this vertex in the context of the given graph
169 169
         Graph::validateVertex($vertex, $this->graph->getVertices());
170 170
         // check if there is a path
171 171
         if (!$this->hasPathTo($vertex)) {
Please login to merge, or discard this patch.
src/UndirectedGraph.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@
 block discarded – undo
111 111
         // read in the edges
112 112
         for ($i = 0; $i < $edges; $i++) {
113 113
             // fet from source
114
-            $raw = $lines[$i+2];
114
+            $raw = $lines[$i + 2];
115 115
             // parse data
116 116
             list (
117 117
                 $v,
Please login to merge, or discard this patch.
src/GraphClient.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,6 +70,6 @@
 block discarded – undo
70 70
             }
71 71
         }
72 72
         // self loop appears in adjacency list twice
73
-        return $count/2;   
73
+        return $count / 2;   
74 74
     }
75 75
 }
Please login to merge, or discard this patch.
src/Graph.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         // get the ne
47 47
         if (!empty($adjacencyList)) {
48 48
             // set it
49
-            $this->adjacencyList= $adjacencyList;
49
+            $this->adjacencyList = $adjacencyList;
50 50
         } else {
51 51
             // init
52 52
             $this->adjacencyList = [];
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      * @param bool $weight
161 161
      * @return array
162 162
      */
163
-    protected static function parseEdge(string $input,int $vertices, bool $weight = false)
163
+    protected static function parseEdge(string $input, int $vertices, bool $weight = false)
164 164
     {
165 165
         // clean
166 166
         $trimmed = trim($input);
Please login to merge, or discard this patch.
src/EdgeWeightedGraph.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@
 block discarded – undo
171 171
         // init
172 172
         $taken = [];
173 173
         // iterate over the edges
174
-        for ($i = 0; $i <$edges; $i++) {
174
+        for ($i = 0; $i < $edges; $i++) {
175 175
             // generate an edge
176 176
             do {
177 177
                 // generate
Please login to merge, or discard this patch.
src/DFS/TopologicalOrder.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -107,8 +107,7 @@
 block discarded – undo
107 107
         if ($this->hasOrder()) {
108 108
             // return the rank
109 109
             return $this->rank[$vertex];
110
-        }
111
-        else {
110
+        } else {
112 111
             // is not a DAG
113 112
             return -1;
114 113
         }
Please login to merge, or discard this patch.
src/DFS/DepthFirstOrder.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -111,6 +111,6 @@
 block discarded – undo
111 111
      */
112 112
     public function reversePostorder()
113 113
     {
114
-       return $this->reversePost;
114
+        return $this->reversePost;
115 115
     }
116 116
 }
117 117
\ No newline at end of file
Please login to merge, or discard this patch.
src/Edge.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@
 block discarded – undo
117 117
         if ($weight < $otherWeight) {
118 118
             // return less than
119 119
             return -1;
120
-        } else if ($weight == $otherWeight){
120
+        } else if ($weight == $otherWeight) {
121 121
             // return equal
122 122
             return 0;
123 123
         } else {
Please login to merge, or discard this patch.
src/Digraph.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@
 block discarded – undo
111 111
         // read in the edges
112 112
         for ($i = 0; $i < $edges; $i++) {
113 113
             // fet from source
114
-            $raw = $lines[$i+2];
114
+            $raw = $lines[$i + 2];
115 115
             // parse data
116 116
             list (
117 117
                 $v,
Please login to merge, or discard this patch.