Failed Conditions
Pull Request — master (#373)
by Florian
02:49
created
functions.php 1 patch
Braces   +22 added lines, -11 removed lines patch added patch discarded remove patch
@@ -60,7 +60,8 @@  discard block
 block discarded – undo
60 60
     }
61 61
 }
62 62
 
63
-function time_ago_day($timestamp, $locales) {
63
+function time_ago_day($timestamp, $locales)
64
+{
64 65
     $spawn = new DateTime($timestamp);
65 66
     $now = new DateTime();
66 67
 
@@ -215,11 +216,14 @@  discard block
 block discarded – undo
215 216
 //#######################################################################
216 217
 function get_tree_at_depth($trees, $depth, $max_pokemon, $currentDepth = 0)
217 218
 {
218
-    if ($depth == $currentDepth) { // Found depth
219
+    if ($depth == $currentDepth) {
220
+// Found depth
219 221
         return tree_remove_bellow($trees, $max_pokemon);
220
-    } else { // Go deeper
222
+    } else {
223
+// Go deeper
221 224
         $arr = array();
222
-        foreach ($trees as $temp) { // Go into all trees
225
+        foreach ($trees as $temp) {
226
+// Go into all trees
223 227
             $tree = $temp->evolutions;
224 228
             $results = tree_remove_bellow(get_tree_at_depth($tree, $depth, $max_pokemon, $currentDepth + 1), $max_pokemon);
225 229
             $arr = tree_check_array($results, $arr, 1 == $depth - $currentDepth);
@@ -236,9 +240,12 @@  discard block
 block discarded – undo
236 240
 {
237 241
     $count = count($array_check);
238 242
     $i = 0;
239
-    if (!is_null($array_check)) { // check if exists
240
-        foreach ($array_check as $res) { // Check if above, equal or bellow center
241
-            if (1 != $count && $correct_arrow) { // only add arrow once
243
+    if (!is_null($array_check)) {
244
+// check if exists
245
+        foreach ($array_check as $res) {
246
+// Check if above, equal or bellow center
247
+            if (1 != $count && $correct_arrow) {
248
+// only add arrow once
242 249
                 $num = $i / ($count - 1);
243 250
                 if ($num < 0.5) {
244 251
                     $res->array_sufix = '_up';
@@ -267,7 +274,8 @@  discard block
 block discarded – undo
267 274
         return null;
268 275
     }
269 276
     $arr = array();
270
-    foreach ($tree as $item) { // Check if above, equal or bellow center
277
+    foreach ($tree as $item) {
278
+// Check if above, equal or bellow center
271 279
         if ($item->id <= $max_pokemon) {
272 280
             $arr[] = $item;
273 281
         }
@@ -311,15 +319,18 @@  discard block
 block discarded – undo
311 319
         for ($i = 1; $i < $geos_count; ++$i) {
312 320
             $geo1 = $geos[$i - 1];
313 321
             $geo2 = $geos[$i];
314
-            if ($geo1['lng'] == $lng && $geo1['lat'] == $lat) { // On one of the coords
322
+            if ($geo1['lng'] == $lng && $geo1['lat'] == $lat) {
323
+// On one of the coords
315 324
                 return true;
316 325
             }
317
-            if ($geo1['lng'] == $geo2['lng'] and $geo1['lng'] == $lng and $lat > min($geo1['lat'], $geo2['lat']) and $lat < max($geo1['lat'], $geo2['lat'])) { // Check if point is on an horizontal polygon boundary
326
+            if ($geo1['lng'] == $geo2['lng'] and $geo1['lng'] == $lng and $lat > min($geo1['lat'], $geo2['lat']) and $lat < max($geo1['lat'], $geo2['lat'])) {
327
+// Check if point is on an horizontal polygon boundary
318 328
                 return true;
319 329
             }
320 330
             if ($lng > min($geo1['lng'], $geo2['lng']) and $lng <= max($geo1['lng'], $geo2['lng']) and $lat <= max($geo1['lat'], $geo2['lat']) and $geo1['lng'] != $geo2['lng']) {
321 331
                 $xinters = ($lng - $geo1['lng']) * ($geo2['lat'] - $geo1['lat']) / ($geo2['lng'] - $geo1['lng']) + $geo1['lat'];
322
-                if ($xinters == $lat) { // Check if point is on the polygon boundary (other than horizontal)
332
+                if ($xinters == $lat) {
333
+// Check if point is on the polygon boundary (other than horizontal)
323 334
                     return true;
324 335
                 }
325 336
                 if ($geo1['lat'] == $geo2['lat'] || $lat <= $xinters) {
Please login to merge, or discard this patch.