@@ -24,11 +24,11 @@ |
||
24 | 24 | */ |
25 | 25 | protected function deleteDeclaration(string $class): void |
26 | 26 | { |
27 | - if (class_exists($class)) { |
|
28 | - try { |
|
27 | + if (class_exists($class)){ |
|
28 | + try{ |
|
29 | 29 | $reflection = new ReflectionClass($class); |
30 | 30 | $this->files()->delete($reflection->getFileName()); |
31 | - } catch (Throwable $exception) { |
|
31 | + }catch (Throwable $exception){ |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 | } |
@@ -24,11 +24,15 @@ |
||
24 | 24 | */ |
25 | 25 | protected function deleteDeclaration(string $class): void |
26 | 26 | { |
27 | - if (class_exists($class)) { |
|
28 | - try { |
|
27 | + if (class_exists($class)) |
|
28 | + { |
|
29 | + try |
|
30 | + { |
|
29 | 31 | $reflection = new ReflectionClass($class); |
30 | 32 | $this->files()->delete($reflection->getFileName()); |
31 | - } catch (Throwable $exception) { |
|
33 | + } |
|
34 | + catch (Throwable $exception) |
|
35 | + { |
|
32 | 36 | } |
33 | 37 | } |
34 | 38 | } |
@@ -61,11 +61,13 @@ |
||
61 | 61 | */ |
62 | 62 | protected function mapDirectories(array $directories): array |
63 | 63 | { |
64 | - if (!isset($directories['root'])) { |
|
64 | + if (!isset($directories['root'])) |
|
65 | + { |
|
65 | 66 | throw new Boot\Exception\BootException('Missing required directory `root`.'); |
66 | 67 | } |
67 | 68 | |
68 | - if (!isset($directories['app'])) { |
|
69 | + if (!isset($directories['app'])) |
|
70 | + { |
|
69 | 71 | $directories['app'] = $directories['root'] . '/'; |
70 | 72 | } |
71 | 73 |
@@ -52,19 +52,19 @@ |
||
52 | 52 | */ |
53 | 53 | protected function mapDirectories(array $directories): array |
54 | 54 | { |
55 | - if (!isset($directories['root'])) { |
|
55 | + if (!isset($directories['root'])){ |
|
56 | 56 | throw new Boot\Exception\BootException('Missing required directory `root`.'); |
57 | 57 | } |
58 | 58 | |
59 | - if (!isset($directories['app'])) { |
|
60 | - $directories['app'] = $directories['root'] . '/'; |
|
59 | + if (!isset($directories['app'])){ |
|
60 | + $directories['app'] = $directories['root'].'/'; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | return array_merge([ |
64 | - 'vendor' => $directories['root'] . '/vendor/', |
|
65 | - 'runtime' => $directories['root'] . '/runtime/', |
|
66 | - 'config' => $directories['app'] . '/config/', |
|
67 | - 'resources' => $directories['root'] . '/resources/', |
|
64 | + 'vendor' => $directories['root'].'/vendor/', |
|
65 | + 'runtime' => $directories['root'].'/runtime/', |
|
66 | + 'config' => $directories['app'].'/config/', |
|
67 | + 'resources' => $directories['root'].'/resources/', |
|
68 | 68 | ], $directories); |
69 | 69 | } |
70 | 70 | } |
@@ -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 |
@@ -54,9 +54,12 @@ |
||
54 | 54 | $this->requested[$node->name->name] = $node->name->name; |
55 | 55 | } |
56 | 56 | |
57 | - if ($node instanceof Node\Stmt\Property) { |
|
58 | - foreach ($node->props as $prop) { |
|
59 | - if ($prop instanceof Node\Stmt\PropertyProperty) { |
|
57 | + if ($node instanceof Node\Stmt\Property) |
|
58 | + { |
|
59 | + foreach ($node->props as $prop) |
|
60 | + { |
|
61 | + if ($prop instanceof Node\Stmt\PropertyProperty) |
|
62 | + { |
|
60 | 63 | $this->properties[$prop->name->name] = $prop->name->name; |
61 | 64 | } |
62 | 65 | } |
@@ -38,13 +38,13 @@ |
||
38 | 38 | $node->var instanceof Node\Expr\Variable && |
39 | 39 | $node->var->name === 'this' && |
40 | 40 | $node->name instanceof Node\Identifier |
41 | - ) { |
|
41 | + ){ |
|
42 | 42 | $this->requested[$node->name->name] = $node->name->name; |
43 | 43 | } |
44 | 44 | |
45 | - if ($node instanceof Node\Stmt\Property) { |
|
46 | - foreach ($node->props as $prop) { |
|
47 | - if ($prop instanceof Node\Stmt\PropertyProperty) { |
|
45 | + if ($node instanceof Node\Stmt\Property){ |
|
46 | + foreach ($node->props as $prop){ |
|
47 | + if ($prop instanceof Node\Stmt\PropertyProperty){ |
|
48 | 48 | $this->properties[$prop->name->name] = $prop->name->name; |
49 | 49 | } |
50 | 50 | } |
@@ -57,7 +57,7 @@ |
||
57 | 57 | private function traverse(string $code, NodeVisitor ...$visitors): void |
58 | 58 | { |
59 | 59 | $tr = new NodeTraverser(); |
60 | - foreach ($visitors as $visitor) { |
|
60 | + foreach ($visitors as $visitor){ |
|
61 | 61 | $tr->addVisitor($visitor); |
62 | 62 | } |
63 | 63 |
@@ -57,7 +57,8 @@ |
||
57 | 57 | private function traverse(string $code, NodeVisitor ...$visitors): void |
58 | 58 | { |
59 | 59 | $tr = new NodeTraverser(); |
60 | - foreach ($visitors as $visitor) { |
|
60 | + foreach ($visitors as $visitor) |
|
61 | + { |
|
61 | 62 | $tr->addVisitor($visitor); |
62 | 63 | } |
63 | 64 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $e = new PropertyExtractor(); |
22 | 22 | |
23 | 23 | $expected = ['test', 'test2', 'test3', 'testClass']; |
24 | - $prototypes = $e->getPrototypeProperties(file_get_contents(__DIR__ . '/Fixtures/TestClass.php')); |
|
24 | + $prototypes = $e->getPrototypeProperties(file_get_contents(__DIR__.'/Fixtures/TestClass.php')); |
|
25 | 25 | sort($prototypes); |
26 | 26 | $this->assertSame($expected, $prototypes); |
27 | 27 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $e = new PropertyExtractor(); |
32 | 32 | $this->assertSame( |
33 | 33 | [], |
34 | - $e->getPrototypeProperties(file_get_contents(__DIR__ . '/Fixtures/HydratedClass.php')) |
|
34 | + $e->getPrototypeProperties(file_get_contents(__DIR__.'/Fixtures/HydratedClass.php')) |
|
35 | 35 | ); |
36 | 36 | } |
37 | 37 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | public function testNoClass(): void |
19 | 19 | { |
20 | 20 | $this->expectException(ClassNotDeclaredException::class); |
21 | - $this->getExtractor()->extract(dirname(__DIR__) . '/Fixtures/noClass.php', []); |
|
21 | + $this->getExtractor()->extract(dirname(__DIR__).'/Fixtures/noClass.php', []); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | private function getExtractor(): NodeExtractor |
@@ -28,15 +28,15 @@ |
||
28 | 28 | // empty input |
29 | 29 | [[], 5, 5], |
30 | 30 | // in the gap (not taken) |
31 | - [[3, 4, 8, 9,], 6, 6], |
|
32 | - [[3, 4, 8, 9,], 1, 1], |
|
31 | + [[3, 4, 8, 9, ], 6, 6], |
|
32 | + [[3, 4, 8, 9, ], 1, 1], |
|
33 | 33 | // in the sequence (taken) |
34 | - [[3, 4, 8, 9,], 4, 0], |
|
35 | - [[0, 1, 4, 5,], 5, 2], |
|
34 | + [[3, 4, 8, 9, ], 4, 0], |
|
35 | + [[0, 1, 4, 5, ], 5, 2], |
|
36 | 36 | // do not use "1" |
37 | - [[0, 3, 4, 8,], 4, 2], |
|
37 | + [[0, 3, 4, 8, ], 4, 2], |
|
38 | 38 | // full sequence, take next |
39 | - [[0, 1, 2, 3,], 3, 4], |
|
39 | + [[0, 1, 2, 3, ], 3, 4], |
|
40 | 40 | [[0], 0, 2], |
41 | 41 | ]; |
42 | 42 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | ?int $int = 123, |
21 | 21 | \StdClass $nullableClass2 = null, |
22 | 22 | string ...$variadicVar |
23 | - ) { |
|
23 | + ){ |
|
24 | 24 | $var2 = new ATest3(); |
25 | 25 | } |
26 | 26 | } |