@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $source = file_get_contents($filename); |
35 | 35 | self::assertStringContainsString('use PrototypeTrait;', $source); |
36 | 36 | |
37 | - try { |
|
37 | + try{ |
|
38 | 38 | $this->app->bindApp(); |
39 | 39 | |
40 | 40 | $inp = new ArrayInput(['--remove' => true]); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $this->app->get(Console::class)->run('prototype:inject', $inp, $out); |
43 | 43 | |
44 | 44 | self::assertStringNotContainsString('use PrototypeTrait;', file_get_contents($filename)); |
45 | - } finally { |
|
45 | + }finally{ |
|
46 | 46 | file_put_contents($filename, $source); |
47 | 47 | } |
48 | 48 | } |
@@ -34,7 +34,8 @@ discard block |
||
34 | 34 | $source = file_get_contents($filename); |
35 | 35 | self::assertStringContainsString('use PrototypeTrait;', $source); |
36 | 36 | |
37 | - try { |
|
37 | + try |
|
38 | + { |
|
38 | 39 | $this->app->bindApp(); |
39 | 40 | |
40 | 41 | $inp = new ArrayInput(['--remove' => true]); |
@@ -42,7 +43,9 @@ discard block |
||
42 | 43 | $this->app->get(Console::class)->run('prototype:inject', $inp, $out); |
43 | 44 | |
44 | 45 | self::assertStringNotContainsString('use PrototypeTrait;', file_get_contents($filename)); |
45 | - } finally { |
|
46 | + } |
|
47 | + finally |
|
48 | + { |
|
46 | 49 | file_put_contents($filename, $source); |
47 | 50 | } |
48 | 51 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $e = new PropertyExtractor(); |
15 | 15 | |
16 | 16 | $expected = ['test', 'test2', 'test3', 'testClass']; |
17 | - $prototypes = $e->getPrototypeProperties(file_get_contents(__DIR__ . '/Fixtures/TestClass.php')); |
|
17 | + $prototypes = $e->getPrototypeProperties(file_get_contents(__DIR__.'/Fixtures/TestClass.php')); |
|
18 | 18 | sort($prototypes); |
19 | 19 | self::assertSame($expected, $prototypes); |
20 | 20 | } |
@@ -22,6 +22,6 @@ discard block |
||
22 | 22 | public function testExtractNone(): void |
23 | 23 | { |
24 | 24 | $e = new PropertyExtractor(); |
25 | - self::assertSame([], $e->getPrototypeProperties(file_get_contents(__DIR__ . '/Fixtures/HydratedClass.php'))); |
|
25 | + self::assertSame([], $e->getPrototypeProperties(file_get_contents(__DIR__.'/Fixtures/HydratedClass.php'))); |
|
26 | 26 | } |
27 | 27 | } |
@@ -142,7 +142,7 @@ |
||
142 | 142 | $file->addUse('Foo\\Bar'); |
143 | 143 | $file->addClass('Test')->addImplement('Foo\\Bar'); |
144 | 144 | |
145 | - self::assertStringContainsString('use Foo\\Bar;', (string) $file); |
|
145 | + self::assertStringContainsString('use Foo\\Bar;', (string)$file); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | public function testStrictTypes(): void |
@@ -133,38 +133,38 @@ |
||
133 | 133 | $method = new Method('test'); |
134 | 134 | self::assertNull($method->getVisibility()); |
135 | 135 | |
136 | - $method->setVisibility(Visibility::PUBLIC); |
|
137 | - self::assertSame(Visibility::PUBLIC, $method->getVisibility()); |
|
136 | + $method->setVisibility(Visibility::public); |
|
137 | + self::assertSame(Visibility::public, $method->getVisibility()); |
|
138 | 138 | self::assertTrue($method->isPublic()); |
139 | 139 | self::assertFalse($method->isProtected()); |
140 | 140 | self::assertFalse($method->isPrivate()); |
141 | 141 | |
142 | - $method->setVisibility(Visibility::PROTECTED); |
|
143 | - self::assertSame(Visibility::PROTECTED, $method->getVisibility()); |
|
142 | + $method->setVisibility(Visibility::protected); |
|
143 | + self::assertSame(Visibility::protected, $method->getVisibility()); |
|
144 | 144 | self::assertFalse($method->isPublic()); |
145 | 145 | self::assertTrue($method->isProtected()); |
146 | 146 | self::assertFalse($method->isPrivate()); |
147 | 147 | |
148 | - $method->setVisibility(Visibility::PRIVATE); |
|
149 | - self::assertSame(Visibility::PRIVATE, $method->getVisibility()); |
|
148 | + $method->setVisibility(Visibility::private); |
|
149 | + self::assertSame(Visibility::private, $method->getVisibility()); |
|
150 | 150 | self::assertFalse($method->isPublic()); |
151 | 151 | self::assertFalse($method->isProtected()); |
152 | 152 | self::assertTrue($method->isPrivate()); |
153 | 153 | |
154 | 154 | $method->setPublic(); |
155 | - self::assertSame(Visibility::PUBLIC, $method->getVisibility()); |
|
155 | + self::assertSame(Visibility::public, $method->getVisibility()); |
|
156 | 156 | self::assertTrue($method->isPublic()); |
157 | 157 | self::assertFalse($method->isProtected()); |
158 | 158 | self::assertFalse($method->isPrivate()); |
159 | 159 | |
160 | 160 | $method->setProtected(); |
161 | - self::assertSame(Visibility::PROTECTED, $method->getVisibility()); |
|
161 | + self::assertSame(Visibility::protected, $method->getVisibility()); |
|
162 | 162 | self::assertFalse($method->isPublic()); |
163 | 163 | self::assertTrue($method->isProtected()); |
164 | 164 | self::assertFalse($method->isPrivate()); |
165 | 165 | |
166 | 166 | $method->setPrivate(); |
167 | - self::assertSame(Visibility::PRIVATE, $method->getVisibility()); |
|
167 | + self::assertSame(Visibility::private, $method->getVisibility()); |
|
168 | 168 | self::assertFalse($method->isPublic()); |
169 | 169 | self::assertFalse($method->isProtected()); |
170 | 170 | self::assertTrue($method->isPrivate()); |
@@ -35,38 +35,38 @@ |
||
35 | 35 | $param = new PromotedParameter('test'); |
36 | 36 | self::assertNull($param->getVisibility()); |
37 | 37 | |
38 | - $param->setVisibility(Visibility::PUBLIC); |
|
39 | - self::assertSame(Visibility::PUBLIC, $param->getVisibility()); |
|
38 | + $param->setVisibility(Visibility::public); |
|
39 | + self::assertSame(Visibility::public, $param->getVisibility()); |
|
40 | 40 | self::assertTrue($param->isPublic()); |
41 | 41 | self::assertFalse($param->isProtected()); |
42 | 42 | self::assertFalse($param->isPrivate()); |
43 | 43 | |
44 | - $param->setVisibility(Visibility::PROTECTED); |
|
45 | - self::assertSame(Visibility::PROTECTED, $param->getVisibility()); |
|
44 | + $param->setVisibility(Visibility::protected); |
|
45 | + self::assertSame(Visibility::protected, $param->getVisibility()); |
|
46 | 46 | self::assertFalse($param->isPublic()); |
47 | 47 | self::assertTrue($param->isProtected()); |
48 | 48 | self::assertFalse($param->isPrivate()); |
49 | 49 | |
50 | - $param->setVisibility(Visibility::PRIVATE); |
|
51 | - self::assertSame(Visibility::PRIVATE, $param->getVisibility()); |
|
50 | + $param->setVisibility(Visibility::private); |
|
51 | + self::assertSame(Visibility::private, $param->getVisibility()); |
|
52 | 52 | self::assertFalse($param->isPublic()); |
53 | 53 | self::assertFalse($param->isProtected()); |
54 | 54 | self::assertTrue($param->isPrivate()); |
55 | 55 | |
56 | 56 | $param->setPublic(); |
57 | - self::assertSame(Visibility::PUBLIC, $param->getVisibility()); |
|
57 | + self::assertSame(Visibility::public, $param->getVisibility()); |
|
58 | 58 | self::assertTrue($param->isPublic()); |
59 | 59 | self::assertFalse($param->isProtected()); |
60 | 60 | self::assertFalse($param->isPrivate()); |
61 | 61 | |
62 | 62 | $param->setProtected(); |
63 | - self::assertSame(Visibility::PROTECTED, $param->getVisibility()); |
|
63 | + self::assertSame(Visibility::protected, $param->getVisibility()); |
|
64 | 64 | self::assertFalse($param->isPublic()); |
65 | 65 | self::assertTrue($param->isProtected()); |
66 | 66 | self::assertFalse($param->isPrivate()); |
67 | 67 | |
68 | 68 | $param->setPrivate(); |
69 | - self::assertSame(Visibility::PRIVATE, $param->getVisibility()); |
|
69 | + self::assertSame(Visibility::private, $param->getVisibility()); |
|
70 | 70 | self::assertFalse($param->isPublic()); |
71 | 71 | self::assertFalse($param->isProtected()); |
72 | 72 | self::assertTrue($param->isPrivate()); |
@@ -59,38 +59,38 @@ |
||
59 | 59 | $property = new Property('foo'); |
60 | 60 | self::assertNull($property->getVisibility()); |
61 | 61 | |
62 | - $property->setVisibility(Visibility::PUBLIC); |
|
63 | - self::assertSame(Visibility::PUBLIC, $property->getVisibility()); |
|
62 | + $property->setVisibility(Visibility::public); |
|
63 | + self::assertSame(Visibility::public, $property->getVisibility()); |
|
64 | 64 | self::assertTrue($property->isPublic()); |
65 | 65 | self::assertFalse($property->isProtected()); |
66 | 66 | self::assertFalse($property->isPrivate()); |
67 | 67 | |
68 | - $property->setVisibility(Visibility::PROTECTED); |
|
69 | - self::assertSame(Visibility::PROTECTED, $property->getVisibility()); |
|
68 | + $property->setVisibility(Visibility::protected); |
|
69 | + self::assertSame(Visibility::protected, $property->getVisibility()); |
|
70 | 70 | self::assertFalse($property->isPublic()); |
71 | 71 | self::assertTrue($property->isProtected()); |
72 | 72 | self::assertFalse($property->isPrivate()); |
73 | 73 | |
74 | - $property->setVisibility(Visibility::PRIVATE); |
|
75 | - self::assertSame(Visibility::PRIVATE, $property->getVisibility()); |
|
74 | + $property->setVisibility(Visibility::private); |
|
75 | + self::assertSame(Visibility::private, $property->getVisibility()); |
|
76 | 76 | self::assertFalse($property->isPublic()); |
77 | 77 | self::assertFalse($property->isProtected()); |
78 | 78 | self::assertTrue($property->isPrivate()); |
79 | 79 | |
80 | 80 | $property->setPublic(); |
81 | - self::assertSame(Visibility::PUBLIC, $property->getVisibility()); |
|
81 | + self::assertSame(Visibility::public, $property->getVisibility()); |
|
82 | 82 | self::assertTrue($property->isPublic()); |
83 | 83 | self::assertFalse($property->isProtected()); |
84 | 84 | self::assertFalse($property->isPrivate()); |
85 | 85 | |
86 | 86 | $property->setProtected(); |
87 | - self::assertSame(Visibility::PROTECTED, $property->getVisibility()); |
|
87 | + self::assertSame(Visibility::protected, $property->getVisibility()); |
|
88 | 88 | self::assertFalse($property->isPublic()); |
89 | 89 | self::assertTrue($property->isProtected()); |
90 | 90 | self::assertFalse($property->isPrivate()); |
91 | 91 | |
92 | 92 | $property->setPrivate(); |
93 | - self::assertSame(Visibility::PRIVATE, $property->getVisibility()); |
|
93 | + self::assertSame(Visibility::private, $property->getVisibility()); |
|
94 | 94 | self::assertFalse($property->isPublic()); |
95 | 95 | self::assertFalse($property->isProtected()); |
96 | 96 | self::assertTrue($property->isPrivate()); |
@@ -22,22 +22,22 @@ |
||
22 | 22 | |
23 | 23 | public function loadEnvVariables(DirectoriesInterface $dirs, EnvironmentInterface $env): void |
24 | 24 | { |
25 | - if ($this->init) { |
|
25 | + if ($this->init){ |
|
26 | 26 | return; |
27 | 27 | } |
28 | 28 | |
29 | 29 | $this->init = true; |
30 | 30 | |
31 | - $dotenvPath = $env->get('DOTENV_PATH', $dirs->get('root') . '.env'); |
|
31 | + $dotenvPath = $env->get('DOTENV_PATH', $dirs->get('root').'.env'); |
|
32 | 32 | |
33 | - if (!\file_exists($dotenvPath)) { |
|
33 | + if (!\file_exists($dotenvPath)){ |
|
34 | 34 | return; |
35 | 35 | } |
36 | 36 | |
37 | - $path = \dirname((string) $dotenvPath); |
|
38 | - $file = \basename((string) $dotenvPath); |
|
37 | + $path = \dirname((string)$dotenvPath); |
|
38 | + $file = \basename((string)$dotenvPath); |
|
39 | 39 | |
40 | - foreach (Dotenv::createImmutable($path, $file)->load() as $key => $value) { |
|
40 | + foreach (Dotenv::createImmutable($path, $file)->load() as $key => $value){ |
|
41 | 41 | $env->set($key, $value); |
42 | 42 | } |
43 | 43 | } |
@@ -22,7 +22,8 @@ discard block |
||
22 | 22 | |
23 | 23 | public function loadEnvVariables(DirectoriesInterface $dirs, EnvironmentInterface $env): void |
24 | 24 | { |
25 | - if ($this->init) { |
|
25 | + if ($this->init) |
|
26 | + { |
|
26 | 27 | return; |
27 | 28 | } |
28 | 29 | |
@@ -30,14 +31,16 @@ discard block |
||
30 | 31 | |
31 | 32 | $dotenvPath = $env->get('DOTENV_PATH', $dirs->get('root') . '.env'); |
32 | 33 | |
33 | - if (!\file_exists($dotenvPath)) { |
|
34 | + if (!\file_exists($dotenvPath)) |
|
35 | + { |
|
34 | 36 | return; |
35 | 37 | } |
36 | 38 | |
37 | 39 | $path = \dirname((string) $dotenvPath); |
38 | 40 | $file = \basename((string) $dotenvPath); |
39 | 41 | |
40 | - foreach (Dotenv::createImmutable($path, $file)->load() as $key => $value) { |
|
42 | + foreach (Dotenv::createImmutable($path, $file)->load() as $key => $value) |
|
43 | + { |
|
41 | 44 | $env->set($key, $value); |
42 | 45 | } |
43 | 46 | } |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | { |
44 | 44 | $s = $this->getStempler(); |
45 | 45 | |
46 | - try { |
|
46 | + try{ |
|
47 | 47 | $s->get('echo', new ViewContext())->render(); |
48 | 48 | $this->fail('Exception expected'); |
49 | - } catch (RenderException $e) { |
|
49 | + }catch (RenderException $e){ |
|
50 | 50 | $t = $e->getUserTrace()[0]; |
51 | 51 | |
52 | 52 | self::assertSame(2, $t['line']); |
@@ -58,10 +58,10 @@ discard block |
||
58 | 58 | { |
59 | 59 | $s = $this->getStempler(); |
60 | 60 | |
61 | - try { |
|
61 | + try{ |
|
62 | 62 | $s->get('other:echo-in', new ViewContext())->render(); |
63 | 63 | $this->fail('Exception expected'); |
64 | - } catch (RenderException $e) { |
|
64 | + }catch (RenderException $e){ |
|
65 | 65 | $t = $e->getUserTrace(); |
66 | 66 | self::assertCount(2, $t); |
67 | 67 | |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | { |
78 | 78 | $twig = $this->getStempler(); |
79 | 79 | |
80 | - try { |
|
80 | + try{ |
|
81 | 81 | $twig->get('other:bad', new ViewContext()); |
82 | - } catch (CompileException $e) { |
|
82 | + }catch (CompileException $e){ |
|
83 | 83 | self::assertStringContainsString('bad.dark.php', $e->getFile()); |
84 | 84 | } |
85 | 85 | } |
@@ -43,10 +43,13 @@ discard block |
||
43 | 43 | { |
44 | 44 | $s = $this->getStempler(); |
45 | 45 | |
46 | - try { |
|
46 | + try |
|
47 | + { |
|
47 | 48 | $s->get('echo', new ViewContext())->render(); |
48 | 49 | $this->fail('Exception expected'); |
49 | - } catch (RenderException $e) { |
|
50 | + } |
|
51 | + catch (RenderException $e) |
|
52 | + { |
|
50 | 53 | $t = $e->getUserTrace()[0]; |
51 | 54 | |
52 | 55 | self::assertSame(2, $t['line']); |
@@ -58,10 +61,13 @@ discard block |
||
58 | 61 | { |
59 | 62 | $s = $this->getStempler(); |
60 | 63 | |
61 | - try { |
|
64 | + try |
|
65 | + { |
|
62 | 66 | $s->get('other:echo-in', new ViewContext())->render(); |
63 | 67 | $this->fail('Exception expected'); |
64 | - } catch (RenderException $e) { |
|
68 | + } |
|
69 | + catch (RenderException $e) |
|
70 | + { |
|
65 | 71 | $t = $e->getUserTrace(); |
66 | 72 | self::assertCount(2, $t); |
67 | 73 | |
@@ -77,9 +83,12 @@ discard block |
||
77 | 83 | { |
78 | 84 | $twig = $this->getStempler(); |
79 | 85 | |
80 | - try { |
|
86 | + try |
|
87 | + { |
|
81 | 88 | $twig->get('other:bad', new ViewContext()); |
82 | - } catch (CompileException $e) { |
|
89 | + } |
|
90 | + catch (CompileException $e) |
|
91 | + { |
|
83 | 92 | self::assertStringContainsString('bad.dark.php', $e->getFile()); |
84 | 93 | } |
85 | 94 | } |
@@ -13,5 +13,5 @@ |
||
13 | 13 | public array $allowEnv = [], |
14 | 14 | public array $denyEnv = [], |
15 | 15 | public bool $override = true, |
16 | - ) {} |
|
16 | + ){} |
|
17 | 17 | } |
@@ -13,5 +13,6 @@ |
||
13 | 13 | public array $allowEnv = [], |
14 | 14 | public array $denyEnv = [], |
15 | 15 | public bool $override = true, |
16 | - ) {} |
|
16 | + ) { |
|
17 | +} |
|
17 | 18 | } |