@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | { |
28 | 28 | $files = new Files(); |
29 | 29 | |
30 | - $filename = self::FIXTURE_DIRECTORY . '/test.txt'; |
|
30 | + $filename = self::FIXTURE_DIRECTORY.'/test.txt'; |
|
31 | 31 | self::assertFalse($files->exists($filename)); |
32 | 32 | |
33 | 33 | $files->write($filename, 'some-data'); |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | { |
41 | 41 | $files = new Files(); |
42 | 42 | |
43 | - $directory = self::FIXTURE_DIRECTORY . '/directory/abc/'; |
|
44 | - $filename = $directory . 'test.txt'; |
|
43 | + $directory = self::FIXTURE_DIRECTORY.'/directory/abc/'; |
|
44 | + $filename = $directory.'test.txt'; |
|
45 | 45 | |
46 | 46 | self::assertFalse($files->exists($directory)); |
47 | 47 | self::assertFalse($files->exists($filename)); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | { |
60 | 60 | $files = new Files(); |
61 | 61 | |
62 | - $filename = self::FIXTURE_DIRECTORY . '/test.txt'; |
|
62 | + $filename = self::FIXTURE_DIRECTORY.'/test.txt'; |
|
63 | 63 | self::assertFalse($files->exists($filename)); |
64 | 64 | |
65 | 65 | $files->write($filename, 'some-data'); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | $files = new Files(); |
77 | 77 | |
78 | - $filename = self::FIXTURE_DIRECTORY . '/test.txt'; |
|
78 | + $filename = self::FIXTURE_DIRECTORY.'/test.txt'; |
|
79 | 79 | self::assertFalse($files->exists($filename)); |
80 | 80 | |
81 | 81 | $files->read($filename); |
@@ -94,14 +94,14 @@ discard block |
||
94 | 94 | $this->expectException(FileNotFoundException::class); |
95 | 95 | |
96 | 96 | $files = new Files(); |
97 | - $files->getPermissions(self::FIXTURE_DIRECTORY . '/missing'); |
|
97 | + $files->getPermissions(self::FIXTURE_DIRECTORY.'/missing'); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | public function testAppend(): void |
101 | 101 | { |
102 | 102 | $files = new Files(); |
103 | 103 | |
104 | - $filename = self::FIXTURE_DIRECTORY . '/test.txt'; |
|
104 | + $filename = self::FIXTURE_DIRECTORY.'/test.txt'; |
|
105 | 105 | self::assertFalse($files->exists($filename)); |
106 | 106 | |
107 | 107 | $files->append($filename, 'some-data'); |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | { |
118 | 118 | $files = new Files(); |
119 | 119 | |
120 | - $directory = self::FIXTURE_DIRECTORY . '/directory/abc/'; |
|
121 | - $filename = $directory . 'test.txt'; |
|
120 | + $directory = self::FIXTURE_DIRECTORY.'/directory/abc/'; |
|
121 | + $filename = $directory.'test.txt'; |
|
122 | 122 | |
123 | 123 | self::assertFalse($files->exists($directory)); |
124 | 124 | self::assertFalse($files->exists($filename)); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | { |
140 | 140 | $files = new Files(); |
141 | 141 | |
142 | - $filename = self::FIXTURE_DIRECTORY . '/test.txt'; |
|
142 | + $filename = self::FIXTURE_DIRECTORY.'/test.txt'; |
|
143 | 143 | |
144 | 144 | self::assertFalse($files->exists($filename)); |
145 | 145 | $files->touch($filename); |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | public function testDelete(): void |
150 | 150 | { |
151 | 151 | $files = new Files(); |
152 | - $filename = self::FIXTURE_DIRECTORY . '/test.txt'; |
|
152 | + $filename = self::FIXTURE_DIRECTORY.'/test.txt'; |
|
153 | 153 | |
154 | 154 | self::assertFalse($files->exists($filename)); |
155 | 155 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | public function testDeleteMissingFile(): void |
164 | 164 | { |
165 | 165 | $files = new Files(); |
166 | - $filename = self::FIXTURE_DIRECTORY . '/test.txt'; |
|
166 | + $filename = self::FIXTURE_DIRECTORY.'/test.txt'; |
|
167 | 167 | |
168 | 168 | self::assertFalse($files->exists($filename)); |
169 | 169 | $files->delete($filename); |
@@ -172,8 +172,8 @@ discard block |
||
172 | 172 | public function testCopy(): void |
173 | 173 | { |
174 | 174 | $files = new Files(); |
175 | - $filename = self::FIXTURE_DIRECTORY . '/test.txt'; |
|
176 | - $destination = self::FIXTURE_DIRECTORY . '/new.txt'; |
|
175 | + $filename = self::FIXTURE_DIRECTORY.'/test.txt'; |
|
176 | + $destination = self::FIXTURE_DIRECTORY.'/new.txt'; |
|
177 | 177 | |
178 | 178 | self::assertFalse($files->exists($filename)); |
179 | 179 | $files->write($filename, 'some-data'); |
@@ -196,8 +196,8 @@ discard block |
||
196 | 196 | $this->expectException(FileNotFoundException::class); |
197 | 197 | |
198 | 198 | $files = new Files(); |
199 | - $filename = self::FIXTURE_DIRECTORY . '/test.txt'; |
|
200 | - $destination = self::FIXTURE_DIRECTORY . '/new.txt'; |
|
199 | + $filename = self::FIXTURE_DIRECTORY.'/test.txt'; |
|
200 | + $destination = self::FIXTURE_DIRECTORY.'/new.txt'; |
|
201 | 201 | |
202 | 202 | self::assertFalse($files->exists($filename)); |
203 | 203 | $files->copy($filename, $destination); |
@@ -206,8 +206,8 @@ discard block |
||
206 | 206 | public function testMove(): void |
207 | 207 | { |
208 | 208 | $files = new Files(); |
209 | - $filename = self::FIXTURE_DIRECTORY . '/test.txt'; |
|
210 | - $destination = self::FIXTURE_DIRECTORY . '/new.txt'; |
|
209 | + $filename = self::FIXTURE_DIRECTORY.'/test.txt'; |
|
210 | + $destination = self::FIXTURE_DIRECTORY.'/new.txt'; |
|
211 | 211 | |
212 | 212 | self::assertFalse($files->exists($filename)); |
213 | 213 | $files->write($filename, 'some-data'); |
@@ -230,8 +230,8 @@ discard block |
||
230 | 230 | $this->expectException(FileNotFoundException::class); |
231 | 231 | |
232 | 232 | $files = new Files(); |
233 | - $filename = self::FIXTURE_DIRECTORY . '/test.txt'; |
|
234 | - $destination = self::FIXTURE_DIRECTORY . '/new.txt'; |
|
233 | + $filename = self::FIXTURE_DIRECTORY.'/test.txt'; |
|
234 | + $destination = self::FIXTURE_DIRECTORY.'/new.txt'; |
|
235 | 235 | |
236 | 236 | self::assertFalse($files->exists($filename)); |
237 | 237 | $files->move($filename, $destination); |
@@ -48,7 +48,7 @@ |
||
48 | 48 | |
49 | 49 | self::assertFalse($files->isDirectory($directory)); |
50 | 50 | |
51 | - $files->write($filename, 'some-data', FilesInterface::READONLY, true); |
|
51 | + $files->write($filename, 'some-data', FilesInterface::readonly, true); |
|
52 | 52 | |
53 | 53 | self::assertTrue($files->isDirectory($directory)); |
54 | 54 | self::assertTrue($files->exists($filename)); |
@@ -119,7 +119,7 @@ |
||
119 | 119 | -o, --id[=ID] Id option description. (multiple values allowed) |
120 | 120 | -Q, --quit Quit option description. |
121 | 121 | --naf[=NAF] Naf option description. [default: "default"] |
122 | -HELP, $core->run(command: 'help', input: ['command_name' => 'foo:bar'])->getOutput()->fetch()); |
|
122 | +help, $core->run(command: 'help', input: ['command_name' => 'foo:bar'])->getOutput()->fetch()); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | public function testDescriptionFromConstant(): void |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | { |
14 | 14 | $core = $this->getCore( |
15 | 15 | $this->getStaticLocator([ |
16 | - new class extends Command { |
|
16 | + new class extends Command{ |
|
17 | 17 | protected const SIGNATURE = 'foo:bar {arg?} {--o|option}'; |
18 | 18 | |
19 | 19 | public function perform(): int |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | $argument = $this->argument('arg'); |
22 | 22 | $option = $this->option('option'); |
23 | 23 | |
24 | - if ($argument) { |
|
25 | - $this->write('argument : ' . $argument); |
|
24 | + if ($argument){ |
|
25 | + $this->write('argument : '.$argument); |
|
26 | 26 | } |
27 | 27 | |
28 | - if ($option) { |
|
29 | - $this->write('option : ' . $option); |
|
28 | + if ($option){ |
|
29 | + $this->write('option : '.$option); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | return 1; |
@@ -50,20 +50,20 @@ discard block |
||
50 | 50 | { |
51 | 51 | $core = $this->getCore( |
52 | 52 | $this->getStaticLocator([ |
53 | - new class extends Command { |
|
53 | + new class extends Command{ |
|
54 | 54 | protected const SIGNATURE = 'foo:bar {arg[]?} {--o|option[]=}'; |
55 | 55 | |
56 | 56 | public function perform(): int |
57 | 57 | { |
58 | - $argument = (array) $this->argument('arg'); |
|
59 | - $option = (array) $this->option('option'); |
|
58 | + $argument = (array)$this->argument('arg'); |
|
59 | + $option = (array)$this->option('option'); |
|
60 | 60 | |
61 | - if ($argument) { |
|
62 | - $this->write('argument : ' . \implode(',', $argument)); |
|
61 | + if ($argument){ |
|
62 | + $this->write('argument : '.\implode(',', $argument)); |
|
63 | 63 | } |
64 | 64 | |
65 | - if ($option) { |
|
66 | - $this->write('option : ' . \implode(',', $option)); |
|
65 | + if ($option){ |
|
66 | + $this->write('option : '.\implode(',', $option)); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | return 1; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | { |
89 | 89 | $core = $this->getCore( |
90 | 90 | $this->getStaticLocator([ |
91 | - new class extends Command { |
|
91 | + new class extends Command{ |
|
92 | 92 | protected const SIGNATURE = 'foo:bar |
93 | 93 | {foo : Foo arg description. } |
94 | 94 | {bar=default : Bar arg description. } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | { |
127 | 127 | $core = $this->getCore( |
128 | 128 | $this->getStaticLocator([ |
129 | - new class extends Command { |
|
129 | + new class extends Command{ |
|
130 | 130 | protected const SIGNATURE = 'foo:bar'; |
131 | 131 | protected const DESCRIPTION = 'baz'; |
132 | 132 |
@@ -13,7 +13,8 @@ discard block |
||
13 | 13 | { |
14 | 14 | $core = $this->getCore( |
15 | 15 | $this->getStaticLocator([ |
16 | - new class extends Command { |
|
16 | + new class extends Command |
|
17 | + { |
|
17 | 18 | protected const SIGNATURE = 'foo:bar {arg?} {--o|option}'; |
18 | 19 | |
19 | 20 | public function perform(): int |
@@ -21,11 +22,13 @@ discard block |
||
21 | 22 | $argument = $this->argument('arg'); |
22 | 23 | $option = $this->option('option'); |
23 | 24 | |
24 | - if ($argument) { |
|
25 | + if ($argument) |
|
26 | + { |
|
25 | 27 | $this->write('argument : ' . $argument); |
26 | 28 | } |
27 | 29 | |
28 | - if ($option) { |
|
30 | + if ($option) |
|
31 | + { |
|
29 | 32 | $this->write('option : ' . $option); |
30 | 33 | } |
31 | 34 | |
@@ -50,7 +53,8 @@ discard block |
||
50 | 53 | { |
51 | 54 | $core = $this->getCore( |
52 | 55 | $this->getStaticLocator([ |
53 | - new class extends Command { |
|
56 | + new class extends Command |
|
57 | + { |
|
54 | 58 | protected const SIGNATURE = 'foo:bar {arg[]?} {--o|option[]=}'; |
55 | 59 | |
56 | 60 | public function perform(): int |
@@ -58,11 +62,13 @@ discard block |
||
58 | 62 | $argument = (array) $this->argument('arg'); |
59 | 63 | $option = (array) $this->option('option'); |
60 | 64 | |
61 | - if ($argument) { |
|
65 | + if ($argument) |
|
66 | + { |
|
62 | 67 | $this->write('argument : ' . \implode(',', $argument)); |
63 | 68 | } |
64 | 69 | |
65 | - if ($option) { |
|
70 | + if ($option) |
|
71 | + { |
|
66 | 72 | $this->write('option : ' . \implode(',', $option)); |
67 | 73 | } |
68 | 74 | |
@@ -88,7 +94,8 @@ discard block |
||
88 | 94 | { |
89 | 95 | $core = $this->getCore( |
90 | 96 | $this->getStaticLocator([ |
91 | - new class extends Command { |
|
97 | + new class extends Command |
|
98 | + { |
|
92 | 99 | protected const SIGNATURE = 'foo:bar |
93 | 100 | {foo : Foo arg description. } |
94 | 101 | {bar=default : Bar arg description. } |
@@ -126,7 +133,8 @@ discard block |
||
126 | 133 | { |
127 | 134 | $core = $this->getCore( |
128 | 135 | $this->getStaticLocator([ |
129 | - new class extends Command { |
|
136 | + new class extends Command |
|
137 | + { |
|
130 | 138 | protected const SIGNATURE = 'foo:bar'; |
131 | 139 | protected const DESCRIPTION = 'baz'; |
132 | 140 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | self::assertCount(0, $routes->getCollection()); |
19 | 19 | |
20 | - $routes->import(\dirname(__DIR__, 2) . '/Fixtures/file.php'); |
|
20 | + $routes->import(\dirname(__DIR__, 2).'/Fixtures/file.php'); |
|
21 | 21 | |
22 | 22 | self::assertCount(3, $routes->getCollection()); |
23 | 23 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | self::assertCount(0, $routes->getCollection()); |
30 | 30 | |
31 | - $routes->import(\dirname(__DIR__, 2) . '/Fixtures/file.php', 'php'); |
|
31 | + $routes->import(\dirname(__DIR__, 2).'/Fixtures/file.php', 'php'); |
|
32 | 32 | |
33 | 33 | self::assertCount(3, $routes->getCollection()); |
34 | 34 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | self::assertCount(0, $routes->getCollection()); |
41 | 41 | |
42 | - $routes->import(\dirname(__DIR__, 2) . '/Fixtures/file.php', 'yaml'); |
|
42 | + $routes->import(\dirname(__DIR__, 2).'/Fixtures/file.php', 'yaml'); |
|
43 | 43 | |
44 | 44 | self::assertCount(0, $routes->getCollection()); |
45 | 45 | } |
@@ -29,12 +29,12 @@ |
||
29 | 29 | { |
30 | 30 | $loader = new PhpFileLoader($this->container, $this->container); |
31 | 31 | |
32 | - $routes = $loader->load(\dirname(__DIR__) . '/Fixtures/file.php'); |
|
32 | + $routes = $loader->load(\dirname(__DIR__).'/Fixtures/file.php'); |
|
33 | 33 | self::assertInstanceOf(RouteCollection::class, $routes); |
34 | 34 | self::assertCount(3, $routes); |
35 | 35 | |
36 | 36 | $this->expectException(LoaderLoadException::class); |
37 | - $loader->load(\dirname(__DIR__) . '/Fixtures/unknown.php'); |
|
37 | + $loader->load(\dirname(__DIR__).'/Fixtures/unknown.php'); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | public function testSupports(): void |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | { |
34 | 34 | $builder = $this->getBuilder($this->getFixtureLoader()); |
35 | 35 | |
36 | - try { |
|
36 | + try{ |
|
37 | 37 | $builder->compile('broken')->getContent(); |
38 | - } catch (ParserException $e) { |
|
38 | + }catch (ParserException $e){ |
|
39 | 39 | self::assertInstanceOf(SyntaxException::class, $e->getPrevious()); |
40 | 40 | self::assertStringContainsString('broken.dark.php', $e->getFile()); |
41 | 41 | self::assertSame(3, $e->getLine()); |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | { |
47 | 47 | $builder = $this->getBuilder($this->getFixtureLoader()); |
48 | 48 | |
49 | - try { |
|
49 | + try{ |
|
50 | 50 | $builder->compile('import/bad-element'); |
51 | - } catch (ImportException $e) { |
|
51 | + }catch (ImportException $e){ |
|
52 | 52 | self::assertStringContainsString('bad-element.dark.php', $e->getFile()); |
53 | 53 | self::assertSame(1, $e->getLine()); |
54 | 54 | } |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | { |
59 | 59 | $builder = $this->getBuilder($this->getFixtureLoader()); |
60 | 60 | |
61 | - try { |
|
61 | + try{ |
|
62 | 62 | $builder->compile('import/bad-element-3'); |
63 | - } catch (ImportException $e) { |
|
63 | + }catch (ImportException $e){ |
|
64 | 64 | self::assertStringContainsString('bad-element-3.dark.php', $e->getFile()); |
65 | 65 | self::assertSame(3, $e->getLine()); |
66 | 66 | } |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | { |
71 | 71 | $builder = $this->getBuilder($this->getFixtureLoader()); |
72 | 72 | |
73 | - try { |
|
73 | + try{ |
|
74 | 74 | $builder->compile('import/bad-dir'); |
75 | - } catch (ImportException $e) { |
|
75 | + }catch (ImportException $e){ |
|
76 | 76 | self::assertStringContainsString('bad-dir.dark.php', $e->getFile()); |
77 | 77 | self::assertSame(1, $e->getLine()); |
78 | 78 | } |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | { |
83 | 83 | $builder = $this->getBuilder($this->getFixtureLoader()); |
84 | 84 | |
85 | - try { |
|
85 | + try{ |
|
86 | 86 | $builder->compile('import/bad-dir-2'); |
87 | - } catch (ImportException $e) { |
|
87 | + }catch (ImportException $e){ |
|
88 | 88 | self::assertStringContainsString('bad-dir-2.dark.php', $e->getFile()); |
89 | 89 | self::assertSame(2, $e->getLine()); |
90 | 90 | } |
@@ -94,9 +94,9 @@ discard block |
||
94 | 94 | { |
95 | 95 | $builder = $this->getBuilder($this->getFixtureLoader()); |
96 | 96 | |
97 | - try { |
|
97 | + try{ |
|
98 | 98 | $builder->compile('bad-directive'); |
99 | - } catch (DirectiveException $e) { |
|
99 | + }catch (DirectiveException $e){ |
|
100 | 100 | self::assertStringContainsString('bad-directive.dark.php', $e->getFile()); |
101 | 101 | self::assertSame(2, $e->getLine()); |
102 | 102 | } |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | { |
107 | 107 | $builder = $this->getBuilder($this->getFixtureLoader()); |
108 | 108 | |
109 | - try { |
|
109 | + try{ |
|
110 | 110 | $builder->compile('exception-in-import'); |
111 | - } catch (ImportException $e) { |
|
111 | + }catch (ImportException $e){ |
|
112 | 112 | self::assertStringContainsString('exception-in-import.dark.php', $e->getFile()); |
113 | 113 | self::assertSame(3, $e->getLine()); |
114 | 114 | |
@@ -123,9 +123,9 @@ discard block |
||
123 | 123 | { |
124 | 124 | $builder = $this->getBuilder($this->getFixtureLoader()); |
125 | 125 | |
126 | - try { |
|
126 | + try{ |
|
127 | 127 | $builder->compile('exception-in-import-2'); |
128 | - } catch (ImportException $e) { |
|
128 | + }catch (ImportException $e){ |
|
129 | 129 | self::assertInstanceOf(ImportException::class, $e); |
130 | 130 | self::assertStringContainsString('exception-in-import-2.dark.php', $e->getFile()); |
131 | 131 | self::assertSame(3, $e->getLine()); |
@@ -141,9 +141,9 @@ discard block |
||
141 | 141 | { |
142 | 142 | $builder = $this->getBuilder($this->getFixtureLoader()); |
143 | 143 | |
144 | - try { |
|
144 | + try{ |
|
145 | 145 | $builder->compile('bad-extends'); |
146 | - } catch (ExtendsException $e) { |
|
146 | + }catch (ExtendsException $e){ |
|
147 | 147 | self::assertStringContainsString('bad-extends.dark.php', $e->getFile()); |
148 | 148 | self::assertSame(1, $e->getLine()); |
149 | 149 | |
@@ -155,9 +155,9 @@ discard block |
||
155 | 155 | { |
156 | 156 | $builder = $this->getBuilder($this->getFixtureLoader()); |
157 | 157 | |
158 | - try { |
|
158 | + try{ |
|
159 | 159 | $builder->compile('bad-extends-2'); |
160 | - } catch (ExtendsException $e) { |
|
160 | + }catch (ExtendsException $e){ |
|
161 | 161 | self::assertInstanceOf(ExtendsException::class, $e); |
162 | 162 | self::assertStringContainsString('bad-extends-2.dark.php', $e->getFile()); |
163 | 163 | self::assertSame(1, $e->getLine()); |
@@ -33,9 +33,12 @@ discard block |
||
33 | 33 | { |
34 | 34 | $builder = $this->getBuilder($this->getFixtureLoader()); |
35 | 35 | |
36 | - try { |
|
36 | + try |
|
37 | + { |
|
37 | 38 | $builder->compile('broken')->getContent(); |
38 | - } catch (ParserException $e) { |
|
39 | + } |
|
40 | + catch (ParserException $e) |
|
41 | + { |
|
39 | 42 | self::assertInstanceOf(SyntaxException::class, $e->getPrevious()); |
40 | 43 | self::assertStringContainsString('broken.dark.php', $e->getFile()); |
41 | 44 | self::assertSame(3, $e->getLine()); |
@@ -46,9 +49,12 @@ discard block |
||
46 | 49 | { |
47 | 50 | $builder = $this->getBuilder($this->getFixtureLoader()); |
48 | 51 | |
49 | - try { |
|
52 | + try |
|
53 | + { |
|
50 | 54 | $builder->compile('import/bad-element'); |
51 | - } catch (ImportException $e) { |
|
55 | + } |
|
56 | + catch (ImportException $e) |
|
57 | + { |
|
52 | 58 | self::assertStringContainsString('bad-element.dark.php', $e->getFile()); |
53 | 59 | self::assertSame(1, $e->getLine()); |
54 | 60 | } |
@@ -58,9 +64,12 @@ discard block |
||
58 | 64 | { |
59 | 65 | $builder = $this->getBuilder($this->getFixtureLoader()); |
60 | 66 | |
61 | - try { |
|
67 | + try |
|
68 | + { |
|
62 | 69 | $builder->compile('import/bad-element-3'); |
63 | - } catch (ImportException $e) { |
|
70 | + } |
|
71 | + catch (ImportException $e) |
|
72 | + { |
|
64 | 73 | self::assertStringContainsString('bad-element-3.dark.php', $e->getFile()); |
65 | 74 | self::assertSame(3, $e->getLine()); |
66 | 75 | } |
@@ -70,9 +79,12 @@ discard block |
||
70 | 79 | { |
71 | 80 | $builder = $this->getBuilder($this->getFixtureLoader()); |
72 | 81 | |
73 | - try { |
|
82 | + try |
|
83 | + { |
|
74 | 84 | $builder->compile('import/bad-dir'); |
75 | - } catch (ImportException $e) { |
|
85 | + } |
|
86 | + catch (ImportException $e) |
|
87 | + { |
|
76 | 88 | self::assertStringContainsString('bad-dir.dark.php', $e->getFile()); |
77 | 89 | self::assertSame(1, $e->getLine()); |
78 | 90 | } |
@@ -82,9 +94,12 @@ discard block |
||
82 | 94 | { |
83 | 95 | $builder = $this->getBuilder($this->getFixtureLoader()); |
84 | 96 | |
85 | - try { |
|
97 | + try |
|
98 | + { |
|
86 | 99 | $builder->compile('import/bad-dir-2'); |
87 | - } catch (ImportException $e) { |
|
100 | + } |
|
101 | + catch (ImportException $e) |
|
102 | + { |
|
88 | 103 | self::assertStringContainsString('bad-dir-2.dark.php', $e->getFile()); |
89 | 104 | self::assertSame(2, $e->getLine()); |
90 | 105 | } |
@@ -94,9 +109,12 @@ discard block |
||
94 | 109 | { |
95 | 110 | $builder = $this->getBuilder($this->getFixtureLoader()); |
96 | 111 | |
97 | - try { |
|
112 | + try |
|
113 | + { |
|
98 | 114 | $builder->compile('bad-directive'); |
99 | - } catch (DirectiveException $e) { |
|
115 | + } |
|
116 | + catch (DirectiveException $e) |
|
117 | + { |
|
100 | 118 | self::assertStringContainsString('bad-directive.dark.php', $e->getFile()); |
101 | 119 | self::assertSame(2, $e->getLine()); |
102 | 120 | } |
@@ -106,9 +124,12 @@ discard block |
||
106 | 124 | { |
107 | 125 | $builder = $this->getBuilder($this->getFixtureLoader()); |
108 | 126 | |
109 | - try { |
|
127 | + try |
|
128 | + { |
|
110 | 129 | $builder->compile('exception-in-import'); |
111 | - } catch (ImportException $e) { |
|
130 | + } |
|
131 | + catch (ImportException $e) |
|
132 | + { |
|
112 | 133 | self::assertStringContainsString('exception-in-import.dark.php', $e->getFile()); |
113 | 134 | self::assertSame(3, $e->getLine()); |
114 | 135 | |
@@ -123,9 +144,12 @@ discard block |
||
123 | 144 | { |
124 | 145 | $builder = $this->getBuilder($this->getFixtureLoader()); |
125 | 146 | |
126 | - try { |
|
147 | + try |
|
148 | + { |
|
127 | 149 | $builder->compile('exception-in-import-2'); |
128 | - } catch (ImportException $e) { |
|
150 | + } |
|
151 | + catch (ImportException $e) |
|
152 | + { |
|
129 | 153 | self::assertInstanceOf(ImportException::class, $e); |
130 | 154 | self::assertStringContainsString('exception-in-import-2.dark.php', $e->getFile()); |
131 | 155 | self::assertSame(3, $e->getLine()); |
@@ -141,9 +165,12 @@ discard block |
||
141 | 165 | { |
142 | 166 | $builder = $this->getBuilder($this->getFixtureLoader()); |
143 | 167 | |
144 | - try { |
|
168 | + try |
|
169 | + { |
|
145 | 170 | $builder->compile('bad-extends'); |
146 | - } catch (ExtendsException $e) { |
|
171 | + } |
|
172 | + catch (ExtendsException $e) |
|
173 | + { |
|
147 | 174 | self::assertStringContainsString('bad-extends.dark.php', $e->getFile()); |
148 | 175 | self::assertSame(1, $e->getLine()); |
149 | 176 | |
@@ -155,9 +182,12 @@ discard block |
||
155 | 182 | { |
156 | 183 | $builder = $this->getBuilder($this->getFixtureLoader()); |
157 | 184 | |
158 | - try { |
|
185 | + try |
|
186 | + { |
|
159 | 187 | $builder->compile('bad-extends-2'); |
160 | - } catch (ExtendsException $e) { |
|
188 | + } |
|
189 | + catch (ExtendsException $e) |
|
190 | + { |
|
161 | 191 | self::assertInstanceOf(ExtendsException::class, $e); |
162 | 192 | self::assertStringContainsString('bad-extends-2.dark.php', $e->getFile()); |
163 | 193 | self::assertSame(1, $e->getLine()); |
@@ -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()); |