@@ -227,7 +227,7 @@ |
||
227 | 227 | */ |
228 | 228 | public function fetchCustomField(array &$record, string $name): array |
229 | 229 | { |
230 | - if (! isset($this->fieldObjects[$name])) { |
|
230 | + if (!isset($this->fieldObjects[$name])) { |
|
231 | 231 | return $record; |
232 | 232 | } |
233 | 233 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | */ |
25 | 25 | public function html(): string |
26 | 26 | { |
27 | - $content = '<textarea class="resizable_textarea '.$this->class.'"'; |
|
27 | + $content = '<textarea class="resizable_textarea ' . $this->class . '"'; |
|
28 | 28 | $content .= $this->required ? ' required="required"' : ''; |
29 | 29 | $content .= ' type="text" name="' . $this->getNamePrefix() . $this->name . |
30 | 30 | ($this->batch ? '[{_creation_form_items_counter}]' : '') . '"'; |
@@ -24,7 +24,7 @@ |
||
24 | 24 | */ |
25 | 25 | public function html(): string |
26 | 26 | { |
27 | - $content = '<input class="'.$this->class.'"'; |
|
27 | + $content = '<input class="' . $this->class . '"'; |
|
28 | 28 | $content .= $this->required ? ' required="required"' : ''; |
29 | 29 | $content .= ' type="text" name="' . $this->getNamePrefix() . $this->name . |
30 | 30 | ($this->batch ? '[{_creation_form_items_counter}]' : '') . '"'; |
@@ -309,7 +309,7 @@ |
||
309 | 309 | 'order' => 'ASC' |
310 | 310 | ], isset($_GET['from']) ? $_GET['from'] : 0, isset($_GET['limit']) ? $_GET['limit'] : 100); |
311 | 311 | |
312 | - if (! empty($records)) { |
|
312 | + if (!empty($records)) { |
|
313 | 313 | $header = $this->listingHeader(); |
314 | 314 | |
315 | 315 | $items = $this->listingItems($records); |
@@ -127,7 +127,7 @@ |
||
127 | 127 | { |
128 | 128 | $records = $this->getListBuilderAdapter()->all(); |
129 | 129 | |
130 | - if (! empty($records)) { |
|
130 | + if (!empty($records)) { |
|
131 | 131 | $header = $this->simpleListingHeader(); |
132 | 132 | |
133 | 133 | $items = $this->simpleListingItems($records); |
@@ -22,27 +22,27 @@ |
||
22 | 22 | return [ |
23 | 23 | // #0, the first case - empty listing |
24 | 24 | [ |
25 | - function (): object { |
|
25 | + function(): object { |
|
26 | 26 | // setup |
27 | 27 | unset($_GET['create-button']); |
28 | 28 | return new ListBuilder\Common($this->getFields(), new FakeAdapter([])); |
29 | 29 | }, |
30 | - function (string $result): void { |
|
30 | + function(string $result): void { |
|
31 | 31 | // asserting method |
32 | 32 | $this->assertStringNotContainsString('create-button"', $result); |
33 | 33 | } |
34 | 34 | ], |
35 | 35 | // #1, the second case - full header |
36 | 36 | [ |
37 | - function (): object { |
|
37 | + function(): object { |
|
38 | 38 | // setup |
39 | 39 | $_GET['create-button'] = 1; |
40 | - if(isset($_GET['create-page-endpoint'])){ |
|
40 | + if (isset($_GET['create-page-endpoint'])) { |
|
41 | 41 | unset($_GET['create-page-endpoint']); |
42 | 42 | } |
43 | 43 | return new ListBuilder\Common($this->getFields(), new FakeAdapter([])); |
44 | 44 | }, |
45 | - function (string $result): void { |
|
45 | + function(string $result): void { |
|
46 | 46 | // asserting method |
47 | 47 | $this->assertStringContainsString('../create/', $result); |
48 | 48 | } |
@@ -22,14 +22,14 @@ discard block |
||
22 | 22 | return [ |
23 | 23 | // #0, the first case - simple header |
24 | 24 | [ |
25 | - function (): object { |
|
25 | + function(): object { |
|
26 | 26 | // setup |
27 | 27 | unset($_GET['create-button']); |
28 | 28 | $listBuilder = new ListBuilder\Common($this->getFields(), new FakeAdapter($this->getRecords())); |
29 | 29 | $listBuilder->setCustomHeaderActions('custom header actions'); |
30 | 30 | return $listBuilder; |
31 | 31 | }, |
32 | - function (string $result): void { |
|
32 | + function(string $result): void { |
|
33 | 33 | // asserting method |
34 | 34 | $this->assertStringContainsString('<form', $result); |
35 | 35 | $this->assertStringContainsString('</form>', $result); |
@@ -39,14 +39,14 @@ discard block |
||
39 | 39 | ], |
40 | 40 | // #1, the second case - full header |
41 | 41 | [ |
42 | - function (): object { |
|
42 | + function(): object { |
|
43 | 43 | // setup |
44 | 44 | $_GET['create-button'] = 1; |
45 | 45 | $listBuilder = new ListBuilder\Common($this->getFields(), new FakeAdapter($this->getRecords())); |
46 | 46 | $listBuilder->setCustomHeaderActions('custom header actions'); |
47 | 47 | return $listBuilder; |
48 | 48 | }, |
49 | - function (string $result): void { |
|
49 | + function(string $result): void { |
|
50 | 50 | // asserting method |
51 | 51 | $this->assertStringContainsString('<form', $result); |
52 | 52 | $this->assertStringContainsString('</form>', $result); |
@@ -56,14 +56,14 @@ discard block |
||
56 | 56 | ], |
57 | 57 | // #2, the third case - simple header |
58 | 58 | [ |
59 | - function (): object { |
|
59 | + function(): object { |
|
60 | 60 | // setup |
61 | 61 | $_GET['create-button'] = 1; |
62 | 62 | $listBuilder = new ListBuilder\Common($this->getFields(), new FakeAdapter([])); |
63 | 63 | $listBuilder->setCustomHeaderActions('custom header actions'); |
64 | 64 | return $listBuilder; |
65 | 65 | }, |
66 | - function (string $result): void { |
|
66 | + function(string $result): void { |
|
67 | 67 | // asserting method |
68 | 68 | $this->assertStringNotContainsString('<form', $result); |
69 | 69 | $this->assertStringNotContainsString('</form>', $result); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $listBuilder = new ListBuilder\Common($this->getFields(), new FakeAdapter($records)); |
119 | 119 | $listBuilder->listTitle = 'Some list title'; |
120 | 120 | $listBuilder->setRecordTransformer( |
121 | - function (object $record): object { |
|
121 | + function(object $record): object { |
|
122 | 122 | Functional::setField($record, 'transformed', 'transformed!'); |
123 | 123 | return $record; |
124 | 124 | }); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | public function commonBehaviourDataProvider(): array |
152 | 152 | { |
153 | - $setup = function (): object { |
|
153 | + $setup = function(): object { |
|
154 | 154 | // setup method |
155 | 155 | $listBuilder = new ListBuilder\Common($this->getFields(), new FakeAdapter($this->getRecords())); |
156 | 156 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | return $listBuilder; |
160 | 160 | }; |
161 | 161 | |
162 | - $assert = function (string $result): void { |
|
162 | + $assert = function(string $result): void { |
|
163 | 163 | // asserting method |
164 | 164 | $this->assertStringNotContainsString('!1!', $result); |
165 | 165 | $this->assertStringNotContainsString('!2!', $result); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | // #0, listingForm |
176 | 176 | [ |
177 | 177 | $setup, |
178 | - function (string $result): void { |
|
178 | + function(string $result): void { |
|
179 | 179 | // asserting method |
180 | 180 | $this->assertStringContainsStrings([ |
181 | 181 | '!1!', |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | ], |
186 | 186 | // #1, listingForm, no custom buttons |
187 | 187 | [ |
188 | - function (): object { |
|
188 | + function(): object { |
|
189 | 189 | // setup method |
190 | 190 | return new ListBuilder\Common($this->getFields(), new FakeAdapter($this->getRecords())); |
191 | 191 | }, |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | ], |
194 | 194 | // #2, listingForm, no custom buttons |
195 | 195 | [ |
196 | - function () use ($headerData): object { |
|
196 | + function() use ($headerData): object { |
|
197 | 197 | // setup method |
198 | 198 | return new ListBuilder\Common($headerData, new FakeAdapter($this->getRecords())); |
199 | 199 | }, |
@@ -201,11 +201,11 @@ discard block |
||
201 | 201 | ], |
202 | 202 | // #3, listingForm, no custom buttons |
203 | 203 | [ |
204 | - function () use ($headerData): object { |
|
204 | + function() use ($headerData): object { |
|
205 | 205 | // setup method |
206 | 206 | return new ListBuilder\Common($headerData, new FakeAdapter($this->getRecords())); |
207 | 207 | }, |
208 | - function (string $result) use ($assert) { |
|
208 | + function(string $result) use ($assert) { |
|
209 | 209 | $assert($result); |
210 | 210 | |
211 | 211 | $this->assertStringContainsStrings([ |
@@ -217,13 +217,13 @@ discard block |
||
217 | 217 | ], |
218 | 218 | // #4, listingForm, default buttons |
219 | 219 | [ |
220 | - function (): object { |
|
220 | + function(): object { |
|
221 | 221 | // setup method |
222 | 222 | $_GET['update-button'] = 1; |
223 | 223 | $_GET['create-button'] = 1; |
224 | 224 | return new ListBuilder\Common($this->getFields(), new FakeAdapter($this->getRecords())); |
225 | 225 | }, |
226 | - function (string $result) use ($assert) { |
|
226 | + function(string $result) use ($assert) { |
|
227 | 227 | $assert($result); |
228 | 228 | |
229 | 229 | $this->assertStringContainsStrings([ |
@@ -235,14 +235,14 @@ discard block |
||
235 | 235 | ], |
236 | 236 | // #5, listingForm, custom title and description |
237 | 237 | [ |
238 | - function (): object { |
|
238 | + function(): object { |
|
239 | 239 | // setup method |
240 | 240 | $listBuilder = new ListBuilder\Common($this->getFields(), new FakeAdapter($this->getRecords())); |
241 | 241 | $listBuilder->listTitle = 'List Title'; |
242 | 242 | $listBuilder->listDescription = 'List Description'; |
243 | 243 | return $listBuilder; |
244 | 244 | }, |
245 | - function (string $result) use ($assert) { |
|
245 | + function(string $result) use ($assert) { |
|
246 | 246 | $assert($result); |
247 | 247 | |
248 | 248 | $this->assertStringContainsStrings([ |
@@ -256,11 +256,11 @@ discard block |
||
256 | 256 | ], |
257 | 257 | // #6, listingForm, default title and description |
258 | 258 | [ |
259 | - function (): object { |
|
259 | + function(): object { |
|
260 | 260 | // setup method |
261 | 261 | return new ListBuilder\Common($this->getFields(), new FakeAdapter($this->getRecords())); |
262 | 262 | }, |
263 | - function (string $result) use ($assert) { |
|
263 | + function(string $result) use ($assert) { |
|
264 | 264 | $assert($result); |
265 | 265 | |
266 | 266 | $this->assertStringContainsStrings( |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $listBuilder = new ListBuilder\Simple($this->getFields(), new FakeAdapter($records)); |
87 | 87 | $listBuilder->listTitle = 'Some list title'; |
88 | 88 | $listBuilder->setRecordTransformer( |
89 | - function (object $record): object { |
|
89 | + function(object $record): object { |
|
90 | 90 | Functional::setField($record, 'transformed', 'transformed!'); |
91 | 91 | return $record; |
92 | 92 | }); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | */ |
119 | 119 | public function commonBehaviourDataProvider(): array |
120 | 120 | { |
121 | - $assert = function (string $result): void { |
|
121 | + $assert = function(string $result): void { |
|
122 | 122 | // asserting method |
123 | 123 | $this->assertStringNotContainsString('!1!', $result); |
124 | 124 | $this->assertStringNotContainsString('!2!', $result); |
@@ -127,14 +127,14 @@ discard block |
||
127 | 127 | return [ |
128 | 128 | // #0, listingForm, custom title and description |
129 | 129 | [ |
130 | - function (): object { |
|
130 | + function(): object { |
|
131 | 131 | // setup method |
132 | 132 | $listBuilder = new ListBuilder\Simple($this->getFields(), new FakeAdapter($this->getRecords())); |
133 | 133 | $listBuilder->listTitle = 'List Title'; |
134 | 134 | $listBuilder->listDescription = 'List Description'; |
135 | 135 | return $listBuilder; |
136 | 136 | }, |
137 | - function (string $result) use ($assert) { |
|
137 | + function(string $result) use ($assert) { |
|
138 | 138 | $assert($result); |
139 | 139 | |
140 | 140 | $this->assertStringContainsStrings([ |
@@ -148,11 +148,11 @@ discard block |
||
148 | 148 | ], |
149 | 149 | // #1, listingForm, default title and description |
150 | 150 | [ |
151 | - function (): object { |
|
151 | + function(): object { |
|
152 | 152 | // setup method |
153 | 153 | return new ListBuilder\Simple($this->getFields(), new FakeAdapter($this->getRecords())); |
154 | 154 | }, |
155 | - function (string $result) use ($assert) { |
|
155 | + function(string $result) use ($assert) { |
|
156 | 156 | $assert($result); |
157 | 157 | |
158 | 158 | $this->assertStringContainsStrings( |