@@ -111,7 +111,7 @@ |
||
| 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, |
@@ -70,6 +70,6 @@ |
||
| 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 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 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 |
||
| 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); |
@@ -171,7 +171,7 @@ |
||
| 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 |
@@ -117,7 +117,7 @@ |
||
| 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 { |
@@ -111,7 +111,7 @@ |
||
| 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, |