Passed
Push — master ( d0fbd1...0825db )
by Daniel
76:55 queued 39:08
created
7 Kyu/get-the-middle-character.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,11 +27,11 @@
 block discarded – undo
27 27
     $length = strlen($text);
28 28
     $middle = $length / 2;
29 29
 
30
-    if($length % 2 == 0) {
31
-        $returnedText = $text[$middle-1];
32
-        $returnedText.= $text[$middle];
30
+    if ($length % 2 == 0) {
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.
7 Kyu/growth-of-a-population.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
     for ($counter; $startpeople < $endpeople; $counter++) {
35 35
         $startpeople = $startpeople * (1 + $percent / 100) + $aug ;    
36 36
     }
37
-      return $counter;
37
+        return $counter;
38 38
 }
39 39
 
40 40
 // Alternate solution with ternary:
Please login to merge, or discard this 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,6 +40,6 @@  discard block
 block discarded – undo
40 40
 // Alternate solution with ternary:
41 41
 function nbYear($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
 }
45 45
 ?>
Please login to merge, or discard this patch.
8 Kyu/positive-sum.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
    
13 13
     foreach ($arr as $value)
14 14
     {
15
-        if($value > 0) { $sum += $value; 
15
+        if ($value > 0) { $sum += $value; 
16 16
         }
17 17
   
18 18
     }
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
     {
13 13
         array_push($number, $i);
14 14
     }
Please login to merge, or discard this patch.
8 Kyu/how-good-are-you-really.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
 
14 14
 function betterThanAverage($classPoints, $yourPoints)
15 15
 {
16
-    $average = array_sum($classPoints)/count($classPoints);
17
-    if($average < $yourPoints) { return true;
16
+    $average = array_sum($classPoints) / count($classPoints);
17
+    if ($average < $yourPoints) { return true;
18 18
     }
19 19
     return false;  
20 20
 }
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     // Alternate solution with ternary operator
23 23
 function betterThanAverage($classPoints, $yourPoints)
24 24
 {
25
-    return array_sum($classPoints)/count($classPoints) < $yourPoints ? true : false;
25
+    return array_sum($classPoints) / count($classPoints) < $yourPoints ? true : false;
26 26
 }
27 27
 
28 28
 // Another solution
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 Remove_Char(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.
5 Kyu/directions-reduction.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,8 @@
 block discarded – undo
52 52
     );
53 53
     $array_count = count($array);
54 54
     $index = 0;
55
-    while ($index < $array_count){
56
-        if($opposite[$array[$index]] == end($stack)) {
55
+    while ($index < $array_count) {
56
+        if ($opposite[$array[$index]] == end($stack)) {
57 57
             array_pop($stack);
58 58
         }           
59 59
         array_push($stack, $array[$index]);
Please login to merge, or discard this patch.
6 Kyu/find-the-odd-int.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
     
17 17
     $count = 0; 
18 18
     $arrCount = count($arr);
19
-    for ($i = 0;  $i < $arrCount; $i++)  
19
+    for ($i = 0; $i < $arrCount; $i++)  
20 20
     { 
21 21
           
22 22
         for ($j = 0; $j < $arrCount; $j++) 
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
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 function solution($number)
11 11
 {
12 12
     $sum = 0;
13
-    for ( $i = 3; $i < $number; $i++) {
13
+    for ($i = 3; $i < $number; $i++) {
14 14
 
15 15
         if ($i % 3 === 0 || $i % 5 === 0) {   
16 16
             $sum += $i;
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 {
26 26
     return array_sum(
27 27
         array_filter(
28
-            range(1, $number-1), function ($item) {
28
+            range(1, $number - 1), function($item) {
29 29
                 return $item % 3 == 0 || $item % 5 == 0;
30 30
             }
31 31
         )
Please login to merge, or discard this patch.