@@ -9,7 +9,7 @@ |
||
9 | 9 | /** |
10 | 10 | * Form constructor. |
11 | 11 | * |
12 | - * @param $x |
|
12 | + * @param integer $x |
|
13 | 13 | */ |
14 | 14 | public function __construct($x) |
15 | 15 | { |
@@ -19,7 +19,7 @@ |
||
19 | 19 | function getX() |
20 | 20 | { |
21 | 21 | //returns closure bound to this object and scope |
22 | - return function () |
|
22 | + return function() |
|
23 | 23 | { |
24 | 24 | return $this->x; |
25 | 25 | }; |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | namespace Kata\PHP7Kata; |
4 | 4 | |
5 | -use Kata\OtherExamples\{Form,Example,NotAnExample}; |
|
5 | +use Kata\OtherExamples\{Form, Example, NotAnExample}; |
|
6 | 6 | |
7 | 7 | final class LegacyToMigrate |
8 | 8 | { |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | 'bird' |
13 | 13 | ]; |
14 | 14 | |
15 | - public function getStringOrNull(?string $param): ?string |
|
15 | + public function getStringOrNull(? string $param) : ? string |
|
16 | 16 | { |
17 | 17 | return $param; |
18 | 18 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $example = new Example(); |
43 | 43 | $not_an_example = new NotAnExample(); |
44 | 44 | |
45 | - return $example->greetings() . ' ' . $not_an_example->greetings() . '!'; |
|
45 | + return $example->greetings().' '.$not_an_example->greetings().'!'; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | public function divideEnters($a, $b) |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | $credit_card = 'daniel:madurell:visa:999888777'; |
56 | 56 | |
57 | 57 | $credit_card = preg_replace_callback_array([ |
58 | - '/([a-z]{1})/' => function ($matches) { |
|
58 | + '/([a-z]{1})/' => function($matches) { |
|
59 | 59 | return strtoupper($matches[1]); |
60 | 60 | }, |
61 | - '/([0-9]{1})/' => function ($matches) { |
|
61 | + '/([0-9]{1})/' => function($matches) { |
|
62 | 62 | return 'XXX'; |
63 | 63 | } |
64 | 64 | ], $credit_card); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | { |
94 | 94 | [$id, $name] = $data[$number_user]; |
95 | 95 | |
96 | - return $id . '_' . $name; |
|
96 | + return $id.'_'.$name; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | public function getAllComposedNames($data) |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | foreach ($data as [$id, $name]) |
104 | 104 | { |
105 | - $all_composed_names .= $id . '_' . $name . '|'; |
|
105 | + $all_composed_names .= $id.'_'.$name.'|'; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | return $all_composed_names; |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | public function printForEachValue() |
142 | 142 | { |
143 | - $gen = function () |
|
143 | + $gen = function() |
|
144 | 144 | { |
145 | 145 | yield 1; |
146 | 146 | }; |
@@ -114,8 +114,7 @@ |
||
114 | 114 | { |
115 | 115 | $this->functionThatFails(); |
116 | 116 | $this->anotherFunctionThatAlsoFails(); |
117 | - } |
|
118 | - catch (FirstException | SecondException $e) |
|
117 | + } catch (FirstException | SecondException $e) |
|
119 | 118 | { |
120 | 119 | return false; |
121 | 120 | } |