@@ -18,7 +18,7 @@ |
||
18 | 18 | * Copyright 2016-18 Hannes Forsgård |
19 | 19 | */ |
20 | 20 | |
21 | -declare(strict_types = 1); |
|
21 | +declare(strict_types=1); |
|
22 | 22 | |
23 | 23 | namespace byrokrat\giroapp\Model; |
24 | 24 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * Copyright 2016-18 Hannes Forsgård |
19 | 19 | */ |
20 | 20 | |
21 | -declare(strict_types = 1); |
|
21 | +declare(strict_types=1); |
|
22 | 22 | |
23 | 23 | namespace byrokrat\giroapp\Mapper; |
24 | 24 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * Copyright 2016-18 Hannes Forsgård |
19 | 19 | */ |
20 | 20 | |
21 | -declare(strict_types = 1); |
|
21 | +declare(strict_types=1); |
|
22 | 22 | |
23 | 23 | namespace byrokrat\giroapp\Mapper\Schema; |
24 | 24 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * Copyright 2016-18 Hannes Forsgård |
19 | 19 | */ |
20 | 20 | |
21 | -declare(strict_types = 1); |
|
21 | +declare(strict_types=1); |
|
22 | 22 | |
23 | 23 | namespace byrokrat\giroapp\DependencyInjection; |
24 | 24 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * Copyright 2016-18 Hannes Forsgård |
19 | 19 | */ |
20 | 20 | |
21 | -declare(strict_types = 1); |
|
21 | +declare(strict_types=1); |
|
22 | 22 | |
23 | 23 | namespace byrokrat\giroapp\Builder; |
24 | 24 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * Copyright 2016-18 Hannes Forsgård |
19 | 19 | */ |
20 | 20 | |
21 | -declare(strict_types = 1); |
|
21 | +declare(strict_types=1); |
|
22 | 22 | |
23 | 23 | namespace byrokrat\giroapp\Console; |
24 | 24 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * Copyright 2016-18 Hannes Forsgård |
19 | 19 | */ |
20 | 20 | |
21 | -declare(strict_types = 1); |
|
21 | +declare(strict_types=1); |
|
22 | 22 | |
23 | 23 | namespace byrokrat\giroapp\Console\Helper; |
24 | 24 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * Copyright 2016-18 Hannes Forsgård |
19 | 19 | */ |
20 | 20 | |
21 | -declare(strict_types = 1); |
|
21 | +declare(strict_types=1); |
|
22 | 22 | |
23 | 23 | namespace byrokrat\giroapp\Console\Helper; |
24 | 24 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | { |
71 | 71 | return (new Rule) |
72 | 72 | ->msg('Valid donor key required') |
73 | - ->match(function ($val) { |
|
73 | + ->match(function($val) { |
|
74 | 74 | return preg_match('/^[a-zA-Z0-9]{1,16}$/', $val); |
75 | 75 | }); |
76 | 76 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | return (new Rule) |
81 | 81 | ->msg('Amount must be a numerical value') |
82 | 82 | ->match('ctype_digit') |
83 | - ->post(function ($val) { |
|
83 | + ->post(function($val) { |
|
84 | 84 | return new SEK($val); |
85 | 85 | }); |
86 | 86 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | { |
90 | 90 | return (new Rule) |
91 | 91 | ->msg('Valid account number required') |
92 | - ->match(function ($val) { |
|
92 | + ->match(function($val) { |
|
93 | 93 | return preg_match('/^[0-9., -]+$/', $val); |
94 | 94 | }) |
95 | 95 | ->post([$this->accountFactory, 'createAccount']); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | { |
100 | 100 | return (new Rule) |
101 | 101 | ->msg('Valid bankgiro number required') |
102 | - ->match(function ($val) { |
|
102 | + ->match(function($val) { |
|
103 | 103 | return preg_match('/^[0-9., -]+$/', $val); |
104 | 104 | }) |
105 | 105 | ->post([$this->bankgiroFactory, 'createAccount']); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | { |
110 | 110 | return (new Rule) |
111 | 111 | ->msg('Valid id required') |
112 | - ->match(function ($val) { |
|
112 | + ->match(function($val) { |
|
113 | 113 | return preg_match('/^[0-9.,+ -]+$/', $val); |
114 | 114 | }) |
115 | 115 | ->post([$this->idFactory, 'createId']); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | return (new Rule) |
121 | 121 | ->msg('BGC customer number must be a 6 digit number') |
122 | 122 | ->match('ctype_digit') |
123 | - ->match(function ($val) { |
|
123 | + ->match(function($val) { |
|
124 | 124 | return strlen($val) == 6; |
125 | 125 | }); |
126 | 126 | } |
@@ -130,37 +130,37 @@ discard block |
||
130 | 130 | return (new Rule) |
131 | 131 | ->msg('Payer number must be numerical and max 16 digits') |
132 | 132 | ->match('ctype_digit') |
133 | - ->match(function ($val) { |
|
133 | + ->match(function($val) { |
|
134 | 134 | return strlen($val) <= 16; |
135 | 135 | }); |
136 | 136 | } |
137 | 137 | |
138 | 138 | public function getEmailValidator(): callable |
139 | 139 | { |
140 | - return (new Rule)->msg('Email address must be valid')->match(function ($val) { |
|
140 | + return (new Rule)->msg('Email address must be valid')->match(function($val) { |
|
141 | 141 | return empty($val) || filter_var($val, FILTER_VALIDATE_EMAIL); |
142 | 142 | }); |
143 | 143 | } |
144 | 144 | |
145 | 145 | public function getPhoneValidator(): callable |
146 | 146 | { |
147 | - return (new Rule)->msg('Phone number must be valid')->match(function ($val) { |
|
147 | + return (new Rule)->msg('Phone number must be valid')->match(function($val) { |
|
148 | 148 | return !!preg_match('/^\+?[0-9()., -]*$/', $val); |
149 | 149 | }); |
150 | 150 | } |
151 | 151 | |
152 | 152 | public function getPostalCodeValidator(): callable |
153 | 153 | { |
154 | - return (new Rule)->msg('Pustal code must be numerical')->pre(function ($val) { |
|
154 | + return (new Rule)->msg('Pustal code must be numerical')->pre(function($val) { |
|
155 | 155 | return str_replace(' ', '', $val); |
156 | - })->match(function ($val) { |
|
156 | + })->match(function($val) { |
|
157 | 157 | return empty($val) || ctype_digit($val); |
158 | 158 | }); |
159 | 159 | } |
160 | 160 | |
161 | 161 | public function getStringFilter(): callable |
162 | 162 | { |
163 | - return (new Rule)->pre(function ($val) { |
|
163 | + return (new Rule)->pre(function($val) { |
|
164 | 164 | return filter_var( |
165 | 165 | $val, |
166 | 166 | FILTER_UNSAFE_RAW, |
@@ -171,13 +171,13 @@ discard block |
||
171 | 171 | |
172 | 172 | public function getRequiredStringValidator(string $field): callable |
173 | 173 | { |
174 | - return (new Rule)->msg("$field: empty value not allowed")->pre(function ($val) { |
|
174 | + return (new Rule)->msg("$field: empty value not allowed")->pre(function($val) { |
|
175 | 175 | return filter_var( |
176 | 176 | $val, |
177 | 177 | FILTER_UNSAFE_RAW, |
178 | 178 | FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_BACKTICK |
179 | 179 | ); |
180 | - })->match(function ($val) { |
|
180 | + })->match(function($val) { |
|
181 | 181 | return !empty($val); |
182 | 182 | }); |
183 | 183 | } |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | |
218 | 218 | public function getChoiceValidator(array $choices): callable |
219 | 219 | { |
220 | - return function ($val) use ($choices) { |
|
220 | + return function($val) use ($choices) { |
|
221 | 221 | $lower = strtolower((string)$val); |
222 | 222 | |
223 | 223 | if (isset($choices[$lower])) { |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * Copyright 2016-18 Hannes Forsgård |
19 | 19 | */ |
20 | 20 | |
21 | -declare(strict_types = 1); |
|
21 | +declare(strict_types=1); |
|
22 | 22 | |
23 | 23 | namespace byrokrat\giroapp\Formatter; |
24 | 24 |