Passed
Branch master (42cd81)
by Daniel
16:21 queued 13:31
created
6 Kyu/find-the-odd-int.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 {
16 16
     $count = 0;
17 17
     $arrCount = count($arr);
18
-    for ($i = 0;  $i < $arrCount; $i++) {
18
+    for ($i = 0; $i < $arrCount; $i++) {
19 19
         for ($j = 0; $j < $arrCount; $j++) {
20 20
             if ($arr[$i] == $arr[$j]) {
21 21
                 $count++;
Please login to merge, or discard this patch.
6 Kyu/persistent-bugger.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
 function persistence(int $num): int
19 19
 {
20 20
     // Ensure that $num is an integer
21
-    $num = (int)$num;
21
+    $num = (int) $num;
22 22
     $total = 1;
23 23
     
24 24
     $numArray = str_split($num);
25 25
     // Additional type check
26
-    if (true===$numArray) {
26
+    if (true === $numArray) {
27 27
         return 0;
28 28
     }
29 29
     $numArrayCount = count($numArray);
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
 function altPersistence(int $num): int
54 54
 {
55 55
     // Ensure that $num is an integer
56
-    $num = (int)$num;
56
+    $num = (int) $num;
57 57
     $splitNum = str_split($num);
58
-    if (true===$splitNum) {
58
+    if (true === $splitNum) {
59 59
         return 0;
60 60
     }
61 61
     $count = 0;
Please login to merge, or discard this patch.
6 Kyu/multiples-of-3-or-5.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@
 block discarded – undo
24 24
 {
25 25
     return array_sum(
26 26
         array_filter(
27
-            range(1, $number-1),
28
-            function ($item) {
27
+            range(1, $number - 1),
28
+            function($item) {
29 29
                 return $item % 3 == 0 || $item % 5 == 0;
30 30
             }
31 31
         )
Please login to merge, or discard this patch.
7 Kyu/growth-of-a-population.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 {
33 33
     $counter = 0;
34 34
     for ($counter; $startpeople < $endpeople; $counter++) {
35
-        $startpeople = $startpeople * (1 + $percent / 100) + $aug ;
35
+        $startpeople = $startpeople * (1 + $percent / 100) + $aug;
36 36
     }
37 37
     return $counter;
38 38
 }
@@ -40,5 +40,5 @@  discard block
 block discarded – undo
40 40
 // Alternate solution with ternary:
41 41
 function altnbYear($startpeople, $percent, $aug, $endpeople)
42 42
 {
43
-    return $startpeople >= $endpeople ? 0 : 1 + nbYear((int)$startpeople * (1+$percent/100) + $aug, $percent, $aug, $endpeople);
43
+    return $startpeople >= $endpeople ? 0 : 1 + nbYear((int) $startpeople * (1 + $percent / 100) + $aug, $percent, $aug, $endpeople);
44 44
 }
Please login to merge, or discard this patch.
7 Kyu/get-the-middle-character.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@
 block discarded – undo
28 28
     $middle = $length / 2;
29 29
 
30 30
     if ($length % 2 == 0) {
31
-        $returnedText = $text[$middle-1];
32
-        $returnedText.= $text[$middle];
31
+        $returnedText = $text[$middle - 1];
32
+        $returnedText .= $text[$middle];
33 33
     }
34
-    $returnedText.= $text[$middle];
34
+    $returnedText .= $text[$middle];
35 35
     return $returnedText;
36 36
 }
37 37
 
Please login to merge, or discard this patch.
8 Kyu/remove-first-and-last-character.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 function removeChar(string $string)
7 7
 {
8 8
     $removeFirst = substr($string, 1);
9
-    $finalString = substr($removeFirst, 0, strlen($removeFirst)-1);
9
+    $finalString = substr($removeFirst, 0, strlen($removeFirst) - 1);
10 10
     return $finalString;
11 11
 }
12 12
 
Please login to merge, or discard this patch.
8 Kyu/reversed-sequence.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 function reverseSeq($varNumber)
9 9
 {
10 10
     $number = [];
11
-    for ($i = $varNumber; $i > 0;$i--) {
11
+    for ($i = $varNumber; $i > 0; $i--) {
12 12
         array_push($number, $i);
13 13
     }
14 14
     return $number;
Please login to merge, or discard this patch.
8 Kyu/how-good-are-you-really.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 function betterThanAverage($classPoints, $yourPoints)
15 15
 {
16
-    $average = array_sum($classPoints)/count($classPoints);
16
+    $average = array_sum($classPoints) / count($classPoints);
17 17
     if ($average < $yourPoints) {
18 18
         return true;
19 19
     }
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 // Alternate solution with ternary operator
24 24
 function altbetterThanAverage($classPoints, $yourPoints)
25 25
 {
26
-    return array_sum($classPoints)/count($classPoints) < $yourPoints ? true : false;
26
+    return array_sum($classPoints) / count($classPoints) < $yourPoints ? true : false;
27 27
 }
28 28
 
29 29
 // Another solution
Please login to merge, or discard this patch.
7 Kyu/descending-order.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,11 +18,11 @@
 block discarded – undo
18 18
  */
19 19
 function descendingOrder(int $number): int
20 20
 {
21
-  $number = (int)$number;
22
-  $arrayNumber = str_split($number);
21
+    $number = (int)$number;
22
+    $arrayNumber = str_split($number);
23 23
 
24
-  $arrayNumber = (array)$arrayNumber;
25
-  arsort($arrayNumber);
24
+    $arrayNumber = (array)$arrayNumber;
25
+    arsort($arrayNumber);
26 26
 
27
-  return (int)implode($arrayNumber);
27
+    return (int)implode($arrayNumber);
28 28
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,11 +18,11 @@
 block discarded – undo
18 18
  */
19 19
 function descendingOrder(int $number): int
20 20
 {
21
-  $number = (int)$number;
21
+  $number = (int) $number;
22 22
   $arrayNumber = str_split($number);
23 23
 
24
-  $arrayNumber = (array)$arrayNumber;
24
+  $arrayNumber = (array) $arrayNumber;
25 25
   arsort($arrayNumber);
26 26
 
27
-  return (int)implode($arrayNumber);
27
+  return (int) implode($arrayNumber);
28 28
 }
Please login to merge, or discard this patch.