Completed
Push — php7/eduard ( ce4c1b )
by
unknown
02:08
created
src/PHP7Kata/LegacyToMigrate.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
         'bird'
16 16
     ];
17 17
 
18
-    public function getStringOrNull(?string $param): ?string
18
+    public function getStringOrNull(? string $param) : ? string
19 19
     {
20 20
         return $param;
21 21
     }
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     public function arraysSum(...$arrays): array
29 29
     {
30 30
         return array_map(
31
-            function (array $array): int
31
+            function(array $array): int
32 32
             {
33 33
                 return array_sum($array);
34 34
             },
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
     public function strcmpFromC($a, $b)
45 45
     {
46
-<<<<<<< Updated upstream
46
+<< << << < Updated upstream
47 47
         if ($a == $b)
48 48
         {
49 49
             return 0;
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
         {
57 57
             return -1;
58 58
         }
59
-=======
59
+=== === =
60 60
         return $a <=> $b;
61
->>>>>>> Stashed changes
61
+>> >> >> > Stashed changes
62 62
     }
63 63
 
64 64
     public function saySomething()
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         $example        = new Example();
67 67
         $not_an_example = new NotAnExample();
68 68
 
69
-        return $example->greetings() . ' ' . $not_an_example->greetings() . '!';
69
+        return $example->greetings().' '.$not_an_example->greetings().'!';
70 70
     }
71 71
 
72 72
     public function divideEnters($a, $b)
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
 
81 81
         $credit_card = preg_replace_callback_array(
82 82
             [
83
-                '/([a-z]{1})/' => function ($match)
83
+                '/([a-z]{1})/' => function($match)
84 84
                 {
85 85
                     return strtoupper($match[1]);
86 86
                 },
87
-                '/([0-9]{1})/' => function ($match)
87
+                '/([0-9]{1})/' => function($match)
88 88
                 {
89 89
                     return 'XXX';
90 90
                 }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
     public function callingClosures()
99 99
     {
100
-        $getX = function ()
100
+        $getX = function()
101 101
         {
102 102
             return $this->x;
103 103
         };
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     {
124 124
         [$id, $name] = $data[$number_user];
125 125
 
126
-        return $id . '_' . $name;
126
+        return $id.'_'.$name;
127 127
     }
128 128
 
129 129
     public function getAllComposedNames($data)
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
         foreach ($data as list($id, $name))
134 134
         {
135
-            $all_composed_names .= $id . '_' . $name . '|';
135
+            $all_composed_names .= $id.'_'.$name.'|';
136 136
         }
137 137
 
138 138
         return $all_composed_names;
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 
170 170
     public function printForEachValue()
171 171
     {
172
-        $gen = (function ()
172
+        $gen = (function()
173 173
         {
174 174
             yield 1;
175 175
         })();
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -47,12 +47,10 @@  discard block
 block discarded – undo
47 47
         if ($a == $b)
48 48
         {
49 49
             return 0;
50
-        }
51
-        elseif ($a > $b)
50
+        } elseif ($a > $b)
52 51
         {
53 52
             return 1;
54
-        }
55
-        else
53
+        } else
56 54
         {
57 55
             return -1;
58 56
         }
@@ -143,8 +141,7 @@  discard block
 block discarded – undo
143 141
         try
144 142
         {
145 143
             $this->functionThatFails();
146
-        }
147
-        catch (FirstException | SecondException $e)
144
+        } catch (FirstException | SecondException $e)
148 145
         {
149 146
             return false;
150 147
         }
Please login to merge, or discard this patch.