@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | class Validator |
23 | 23 | { |
24 | - public function validateUsername(?string $username): string |
|
24 | + public function validateUsername(?string $username) : string |
|
25 | 25 | { |
26 | 26 | if (empty($username)) { |
27 | 27 | throw new InvalidArgumentException('The username can not be empty.'); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | return $username; |
35 | 35 | } |
36 | 36 | |
37 | - public function validatePassword(?string $plainPassword): string |
|
37 | + public function validatePassword(?string $plainPassword) : string |
|
38 | 38 | { |
39 | 39 | if (empty($plainPassword)) { |
40 | 40 | throw new InvalidArgumentException('The password can not be empty.'); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | return $plainPassword; |
48 | 48 | } |
49 | 49 | |
50 | - public function validateEmail(?string $email): string |
|
50 | + public function validateEmail(?string $email) : string |
|
51 | 51 | { |
52 | 52 | if (empty($email)) { |
53 | 53 | throw new InvalidArgumentException('The email can not be empty.'); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | return $email; |
61 | 61 | } |
62 | 62 | |
63 | - public function validateFullName(?string $fullName): string |
|
63 | + public function validateFullName(?string $fullName) : string |
|
64 | 64 | { |
65 | 65 | if (empty($fullName)) { |
66 | 66 | throw new InvalidArgumentException('The full name can not be empty.'); |
@@ -104,7 +104,7 @@ |
||
104 | 104 | { |
105 | 105 | $terms = array_unique(explode(' ', mb_strtolower($searchQuery))); |
106 | 106 | |
107 | - return array_filter($terms, function ($term) { |
|
107 | + return array_filter($terms, function($term) { |
|
108 | 108 | return 2 <= mb_strlen($term); |
109 | 109 | }); |
110 | 110 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | { |
30 | 30 | private $controller; |
31 | 31 | |
32 | - public function setController(?callable $controller) |
|
32 | + public function setController(? callable $controller) |
|
33 | 33 | { |
34 | 34 | $this->controller = $controller; |
35 | 35 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | ]); |
53 | 53 | } |
54 | 54 | |
55 | - private function getController(): ?array |
|
55 | + private function getController(): ? array |
|
56 | 56 | { |
57 | 57 | // this happens for example for exceptions (404 errors, etc.) |
58 | 58 | if (null === $this->controller) { |
@@ -116,12 +116,12 @@ discard block |
||
116 | 116 | $formattedCode = $code; |
117 | 117 | $codeLines = explode("\n", $code); |
118 | 118 | |
119 | - $indentedLines = array_filter($codeLines, function ($lineOfCode) { |
|
119 | + $indentedLines = array_filter($codeLines, function($lineOfCode) { |
|
120 | 120 | return '' === $lineOfCode || ' ' === mb_substr($lineOfCode, 0, 4); |
121 | 121 | }); |
122 | 122 | |
123 | 123 | if (count($indentedLines) === count($codeLines)) { |
124 | - $formattedCode = array_map(function ($lineOfCode) { |
|
124 | + $formattedCode = array_map(function($lineOfCode) { |
|
125 | 125 | return mb_substr($lineOfCode, 4); |
126 | 126 | }, $codeLines); |
127 | 127 | $formattedCode = implode("\n", $formattedCode); |
@@ -94,7 +94,7 @@ |
||
94 | 94 | $allUsers = $this->users->findBy([], ['id' => 'DESC'], $maxResults); |
95 | 95 | |
96 | 96 | // Doctrine query returns an array of objects and we need an array of plain arrays |
97 | - $usersAsPlainArrays = array_map(function (User $user) { |
|
97 | + $usersAsPlainArrays = array_map(function(User $user) { |
|
98 | 98 | return [ |
99 | 99 | $user->getId(), |
100 | 100 | $user->getFullName(), |