@@ -21,7 +21,7 @@ |
||
21 | 21 | */ |
22 | 22 | public function write($source, SpecificationInterface $specification, Compiler $compiler) |
23 | 23 | { |
24 | - if (!is_iterable($source)) { |
|
24 | + if (!is_iterable($source)){ |
|
25 | 25 | return [$source]; |
26 | 26 | } |
27 | 27 |
@@ -21,7 +21,8 @@ |
||
21 | 21 | */ |
22 | 22 | public function write($source, SpecificationInterface $specification, Compiler $compiler) |
23 | 23 | { |
24 | - if (!is_iterable($source)) { |
|
24 | + if (!is_iterable($source)) |
|
25 | + { |
|
25 | 26 | return [$source]; |
26 | 27 | } |
27 | 28 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | */ |
22 | 22 | public function write($source, SpecificationInterface $specification, Compiler $compiler) |
23 | 23 | { |
24 | - if (is_array($source)) { |
|
24 | + if (is_array($source)){ |
|
25 | 25 | $source[] = get_class($specification); |
26 | 26 | } |
27 | 27 |
@@ -21,7 +21,8 @@ |
||
21 | 21 | */ |
22 | 22 | public function write($source, SpecificationInterface $specification, Compiler $compiler) |
23 | 23 | { |
24 | - if (is_array($source)) { |
|
24 | + if (is_array($source)) |
|
25 | + { |
|
25 | 26 | $source[] = get_class($specification); |
26 | 27 | } |
27 | 28 |
@@ -23,7 +23,7 @@ |
||
23 | 23 | */ |
24 | 24 | public function write($source, SpecificationInterface $specification, Compiler $compiler) |
25 | 25 | { |
26 | - if (is_array($source)) { |
|
26 | + if (is_array($source)){ |
|
27 | 27 | $source[] = self::OUTPUT; |
28 | 28 | } |
29 | 29 |
@@ -23,7 +23,8 @@ |
||
23 | 23 | */ |
24 | 24 | public function write($source, SpecificationInterface $specification, Compiler $compiler) |
25 | 25 | { |
26 | - if (is_array($source)) { |
|
26 | + if (is_array($source)) |
|
27 | + { |
|
27 | 28 | $source[] = self::OUTPUT; |
28 | 29 | } |
29 | 30 |
@@ -101,7 +101,7 @@ |
||
101 | 101 | 'Key2' => 'value2', |
102 | 102 | ]; |
103 | 103 | |
104 | - if ($expectException !== null) { |
|
104 | + if ($expectException !== null){ |
|
105 | 105 | $this->expectException($expectException); |
106 | 106 | } |
107 | 107 |
@@ -101,7 +101,8 @@ |
||
101 | 101 | 'Key2' => 'value2', |
102 | 102 | ]; |
103 | 103 | |
104 | - if ($expectException !== null) { |
|
104 | + if ($expectException !== null) |
|
105 | + { |
|
105 | 106 | $this->expectException($expectException); |
106 | 107 | } |
107 | 108 |
@@ -79,7 +79,7 @@ |
||
79 | 79 | public function testWriters($source, $expected, WriterInterface ...$writers): void |
80 | 80 | { |
81 | 81 | $compiler = new Compiler(); |
82 | - foreach ($writers as $writer) { |
|
82 | + foreach ($writers as $writer){ |
|
83 | 83 | $compiler->addWriter($writer); |
84 | 84 | } |
85 | 85 | $this->assertSame($expected, $compiler->compile($source, new Filter\Equals('', ''))); |
@@ -79,7 +79,8 @@ |
||
79 | 79 | public function testWriters($source, $expected, WriterInterface ...$writers): void |
80 | 80 | { |
81 | 81 | $compiler = new Compiler(); |
82 | - foreach ($writers as $writer) { |
|
82 | + foreach ($writers as $writer) |
|
83 | + { |
|
83 | 84 | $compiler->addWriter($writer); |
84 | 85 | } |
85 | 86 | $this->assertSame($expected, $compiler->compile($source, new Filter\Equals('', ''))); |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $expected, |
236 | 236 | string $expectedException = null |
237 | 237 | ): void { |
238 | - if ($expectedException !== null) { |
|
238 | + if ($expectedException !== null){ |
|
239 | 239 | $this->expectException($expectedException); |
240 | 240 | } |
241 | 241 | |
@@ -297,15 +297,15 @@ discard block |
||
297 | 297 | private function paginatorInput(int $page = null, int $limit = null): array |
298 | 298 | { |
299 | 299 | $result = []; |
300 | - if ($page === null && $limit === null) { |
|
300 | + if ($page === null && $limit === null){ |
|
301 | 301 | return $result; |
302 | 302 | } |
303 | 303 | |
304 | - if ($page !== null) { |
|
304 | + if ($page !== null){ |
|
305 | 305 | $result['page'] = $page; |
306 | 306 | } |
307 | 307 | |
308 | - if ($limit !== null) { |
|
308 | + if ($limit !== null){ |
|
309 | 309 | $result['limit'] = $limit; |
310 | 310 | } |
311 | 311 |
@@ -235,7 +235,8 @@ discard block |
||
235 | 235 | $expected, |
236 | 236 | string $expectedException = null |
237 | 237 | ): void { |
238 | - if ($expectedException !== null) { |
|
238 | + if ($expectedException !== null) |
|
239 | + { |
|
239 | 240 | $this->expectException($expectedException); |
240 | 241 | } |
241 | 242 | |
@@ -297,15 +298,18 @@ discard block |
||
297 | 298 | private function paginatorInput(int $page = null, int $limit = null): array |
298 | 299 | { |
299 | 300 | $result = []; |
300 | - if ($page === null && $limit === null) { |
|
301 | + if ($page === null && $limit === null) |
|
302 | + { |
|
301 | 303 | return $result; |
302 | 304 | } |
303 | 305 | |
304 | - if ($page !== null) { |
|
306 | + if ($page !== null) |
|
307 | + { |
|
305 | 308 | $result['page'] = $page; |
306 | 309 | } |
307 | 310 | |
308 | - if ($limit !== null) { |
|
311 | + if ($limit !== null) |
|
312 | + { |
|
309 | 313 | $result['limit'] = $limit; |
310 | 314 | } |
311 | 315 |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $grid = $grid->withView('ucfirst'); |
57 | 57 | |
58 | 58 | $iterated = []; |
59 | - foreach ($grid->getIterator() as $value) { |
|
59 | + foreach ($grid->getIterator() as $value){ |
|
60 | 60 | $iterated[] = $value; |
61 | 61 | } |
62 | 62 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $grid = $grid->withSource(['a', 'b', 'c', 'hello']); |
73 | 73 | |
74 | 74 | $iterated = []; |
75 | - foreach ($grid->getIterator() as $value) { |
|
75 | + foreach ($grid->getIterator() as $value){ |
|
76 | 76 | $iterated[] = $value; |
77 | 77 | } |
78 | 78 |
@@ -56,7 +56,8 @@ discard block |
||
56 | 56 | $grid = $grid->withView('ucfirst'); |
57 | 57 | |
58 | 58 | $iterated = []; |
59 | - foreach ($grid->getIterator() as $value) { |
|
59 | + foreach ($grid->getIterator() as $value) |
|
60 | + { |
|
60 | 61 | $iterated[] = $value; |
61 | 62 | } |
62 | 63 | |
@@ -72,7 +73,8 @@ discard block |
||
72 | 73 | $grid = $grid->withSource(['a', 'b', 'c', 'hello']); |
73 | 74 | |
74 | 75 | $iterated = []; |
75 | - foreach ($grid->getIterator() as $value) { |
|
76 | + foreach ($grid->getIterator() as $value) |
|
77 | + { |
|
76 | 78 | $iterated[] = $value; |
77 | 79 | } |
78 | 80 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | public function fullName(): string |
33 | 33 | { |
34 | 34 | $name = $this->name; |
35 | - if ($this->sequence > 0) { |
|
35 | + if ($this->sequence > 0){ |
|
36 | 36 | $name .= $this->sequence; |
37 | 37 | } |
38 | 38 |
@@ -32,7 +32,8 @@ |
||
32 | 32 | public function fullName(): string |
33 | 33 | { |
34 | 34 | $name = $this->name; |
35 | - if ($this->sequence > 0) { |
|
35 | + if ($this->sequence > 0) |
|
36 | + { |
|
36 | 37 | $name .= $this->sequence; |
37 | 38 | } |
38 | 39 |
@@ -24,21 +24,21 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public function find(array $sequences, int $originSequence): int |
26 | 26 | { |
27 | - if (empty($sequences) || $originSequence > max($sequences)) { |
|
27 | + if (empty($sequences) || $originSequence > max($sequences)){ |
|
28 | 28 | return $originSequence; |
29 | 29 | } |
30 | 30 | |
31 | 31 | $gaps = $this->skippedSequences($sequences); |
32 | 32 | |
33 | - if (isset($gaps[$originSequence])) { |
|
33 | + if (isset($gaps[$originSequence])){ |
|
34 | 34 | return $originSequence; |
35 | 35 | } |
36 | 36 | |
37 | 37 | //we do not add "1" as postfix: $var, $var2, $var3, etc |
38 | 38 | unset($gaps[1]); |
39 | - if (empty($gaps)) { |
|
39 | + if (empty($gaps)){ |
|
40 | 40 | $max = max($sequences); |
41 | - if ($max === 0) { |
|
41 | + if ($max === 0){ |
|
42 | 42 | return 2; |
43 | 43 | } |
44 | 44 | |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | { |
57 | 57 | $skipped = []; |
58 | 58 | $max = max($sequences); |
59 | - for ($i = 0; $i < $max; $i++) { |
|
60 | - if (!in_array($i, $sequences, true)) { |
|
59 | + for ($i = 0; $i < $max; $i++){ |
|
60 | + if (!in_array($i, $sequences, true)){ |
|
61 | 61 | $skipped[$i] = $i; |
62 | 62 | } |
63 | 63 | } |
@@ -24,21 +24,25 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public function find(array $sequences, int $originSequence): int |
26 | 26 | { |
27 | - if (empty($sequences) || $originSequence > max($sequences)) { |
|
27 | + if (empty($sequences) || $originSequence > max($sequences)) |
|
28 | + { |
|
28 | 29 | return $originSequence; |
29 | 30 | } |
30 | 31 | |
31 | 32 | $gaps = $this->skippedSequences($sequences); |
32 | 33 | |
33 | - if (isset($gaps[$originSequence])) { |
|
34 | + if (isset($gaps[$originSequence])) |
|
35 | + { |
|
34 | 36 | return $originSequence; |
35 | 37 | } |
36 | 38 | |
37 | 39 | //we do not add "1" as postfix: $var, $var2, $var3, etc |
38 | 40 | unset($gaps[1]); |
39 | - if (empty($gaps)) { |
|
41 | + if (empty($gaps)) |
|
42 | + { |
|
40 | 43 | $max = max($sequences); |
41 | - if ($max === 0) { |
|
44 | + if ($max === 0) |
|
45 | + { |
|
42 | 46 | return 2; |
43 | 47 | } |
44 | 48 | |
@@ -56,8 +60,10 @@ discard block |
||
56 | 60 | { |
57 | 61 | $skipped = []; |
58 | 62 | $max = max($sequences); |
59 | - for ($i = 0; $i < $max; $i++) { |
|
60 | - if (!in_array($i, $sequences, true)) { |
|
63 | + for ($i = 0; $i < $max; $i++) |
|
64 | + { |
|
65 | + if (!in_array($i, $sequences, true)) |
|
66 | + { |
|
61 | 67 | $skipped[$i] = $i; |
62 | 68 | } |
63 | 69 | } |