@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | public function __construct($name = null, array $data = [], $dataName = '') |
40 | 40 | { |
41 | - $this->storage = new Storage($this->dir() . '/Fixtures/'); |
|
41 | + $this->storage = new Storage($this->dir().'/Fixtures/'); |
|
42 | 42 | parent::__construct($name, $data, $dataName); |
43 | 43 | } |
44 | 44 | |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | 'cache' => sys_get_temp_dir() |
52 | 52 | ], null, false); |
53 | 53 | |
54 | - foreach (static::STORE as $name) { |
|
54 | + foreach (static::STORE as $name){ |
|
55 | 55 | $this->storage->store($name); |
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
59 | 59 | public function tearDown(): void |
60 | 60 | { |
61 | - foreach (static::STORE as $name) { |
|
61 | + foreach (static::STORE as $name){ |
|
62 | 62 | $this->storage->restore($name); |
63 | 63 | } |
64 | 64 | } |
@@ -51,14 +51,16 @@ |
||
51 | 51 | 'cache' => sys_get_temp_dir() |
52 | 52 | ], null, false); |
53 | 53 | |
54 | - foreach (static::STORE as $name) { |
|
54 | + foreach (static::STORE as $name) |
|
55 | + { |
|
55 | 56 | $this->storage->store($name); |
56 | 57 | } |
57 | 58 | } |
58 | 59 | |
59 | 60 | public function tearDown(): void |
60 | 61 | { |
61 | - foreach (static::STORE as $name) { |
|
62 | + foreach (static::STORE as $name) |
|
63 | + { |
|
62 | 64 | $this->storage->restore($name); |
63 | 65 | } |
64 | 66 | } |
@@ -40,7 +40,7 @@ |
||
40 | 40 | private function makeClasses(): ClassesInterface |
41 | 41 | { |
42 | 42 | return new ClassLocator( |
43 | - (new Finder())->in([__DIR__ . '/Fixtures'])->files() |
|
43 | + (new Finder())->in([__DIR__.'/Fixtures'])->files() |
|
44 | 44 | ); |
45 | 45 | } |
46 | 46 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | public static function convert(array $deps): array |
19 | 19 | { |
20 | 20 | $converted = []; |
21 | - foreach ($deps as $name => $type) { |
|
21 | + foreach ($deps as $name => $type){ |
|
22 | 22 | $converted[$name] = Dependency::create($name, $type); |
23 | 23 | } |
24 | 24 |
@@ -18,7 +18,8 @@ |
||
18 | 18 | public static function convert(array $deps): array |
19 | 19 | { |
20 | 20 | $converted = []; |
21 | - foreach ($deps as $name => $type) { |
|
21 | + foreach ($deps as $name => $type) |
|
22 | + { |
|
22 | 23 | $converted[$name] = Dependency::create($name, $type); |
23 | 24 | } |
24 | 25 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | { |
25 | 25 | public function setUp(): void |
26 | 26 | { |
27 | - if ((string)ini_get('zend.assertions') === 1) { |
|
27 | + if ((string)ini_get('zend.assertions') === 1){ |
|
28 | 28 | ini_set('zend.assertions', 0); |
29 | 29 | } |
30 | 30 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | $i = new Injector(); |
39 | 39 | |
40 | - $filename = __DIR__ . '/Fixtures/TestClass.php'; |
|
40 | + $filename = __DIR__.'/Fixtures/TestClass.php'; |
|
41 | 41 | $printed = $i->injectDependencies( |
42 | 42 | file_get_contents($filename), |
43 | 43 | $this->getDefinition($filename, ['testClass' => TestClass::class]) |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | { |
55 | 55 | $i = new Injector(); |
56 | 56 | |
57 | - $filename = __DIR__ . '/Fixtures/TestEmptyClass.php'; |
|
57 | + $filename = __DIR__.'/Fixtures/TestEmptyClass.php'; |
|
58 | 58 | $content = file_get_contents($filename); |
59 | 59 | $printed = $i->injectDependencies( |
60 | 60 | file_get_contents($filename), |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | { |
73 | 73 | $i = new Injector(); |
74 | 74 | |
75 | - $filename = __DIR__ . '/Fixtures/TestClass.php'; |
|
75 | + $filename = __DIR__.'/Fixtures/TestClass.php'; |
|
76 | 76 | $r = $i->injectDependencies( |
77 | 77 | file_get_contents($filename), |
78 | 78 | $this->getDefinition($filename, ['testClass' => TestClass::class]) |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | { |
98 | 98 | $i = new Injector(); |
99 | 99 | |
100 | - $filename = __DIR__ . '/Fixtures/ChildClass.php'; |
|
100 | + $filename = __DIR__.'/Fixtures/ChildClass.php'; |
|
101 | 101 | $r = $i->injectDependencies( |
102 | 102 | file_get_contents($filename), |
103 | 103 | $this->getDefinition($filename, ['testClass' => TestClass::class]) |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | { |
116 | 116 | $i = new Injector(); |
117 | 117 | |
118 | - $filename = __DIR__ . '/Fixtures/ChildWithConstructorClass.php'; |
|
118 | + $filename = __DIR__.'/Fixtures/ChildWithConstructorClass.php'; |
|
119 | 119 | $r = $i->injectDependencies( |
120 | 120 | file_get_contents($filename), |
121 | 121 | $this->getDefinition($filename, ['testClass' => TestClass::class]) |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function testModifyConstructor(): void |
133 | 133 | { |
134 | - $filename = __DIR__ . '/Fixtures/WithConstructor.php'; |
|
134 | + $filename = __DIR__.'/Fixtures/WithConstructor.php'; |
|
135 | 135 | $traverser = new Traverse\Extractor(); |
136 | 136 | |
137 | 137 | $parameters = $traverser->extractFromFilename($filename); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | */ |
158 | 158 | public function testPriorOptionalConstructorParameters(): void |
159 | 159 | { |
160 | - $filename = __DIR__ . '/Fixtures/OptionalConstructorArgsClass.php'; |
|
160 | + $filename = __DIR__.'/Fixtures/OptionalConstructorArgsClass.php'; |
|
161 | 161 | $traverser = new Traverse\Extractor(); |
162 | 162 | |
163 | 163 | $parameters = $traverser->extractFromFilename($filename); |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | { |
189 | 189 | $i = new Injector(); |
190 | 190 | |
191 | - $filename = __DIR__ . '/ClassNode/ConflictResolver/Fixtures/ChildClass.php'; |
|
191 | + $filename = __DIR__.'/ClassNode/ConflictResolver/Fixtures/ChildClass.php'; |
|
192 | 192 | $printed = $i->injectDependencies( |
193 | 193 | file_get_contents($filename), |
194 | 194 | $this->getDefinition($filename, [ |
@@ -24,7 +24,8 @@ |
||
24 | 24 | { |
25 | 25 | public function setUp(): void |
26 | 26 | { |
27 | - if ((string)ini_get('zend.assertions') === 1) { |
|
27 | + if ((string)ini_get('zend.assertions') === 1) |
|
28 | + { |
|
28 | 29 | ini_set('zend.assertions', 0); |
29 | 30 | } |
30 | 31 | } |
@@ -31,9 +31,9 @@ |
||
31 | 31 | public function trailingProvider(): array |
32 | 32 | { |
33 | 33 | return [ |
34 | - ['name7', 7, 'name',], |
|
35 | - ['name', 0, 'name',], |
|
36 | - ['name0', 0, 'name',], |
|
34 | + ['name7', 7, 'name', ], |
|
35 | + ['name', 0, 'name', ], |
|
36 | + ['name0', 0, 'name', ], |
|
37 | 37 | ['name1', 1, 'name'], |
38 | 38 | ['name-1', 1, 'name-'], |
39 | 39 | ['name-1', -1, 'name'], |
@@ -26,11 +26,11 @@ |
||
26 | 26 | |
27 | 27 | public function store(string $name): void |
28 | 28 | { |
29 | - $this->storage[$name] = file_get_contents($this->dir . $name); |
|
29 | + $this->storage[$name] = file_get_contents($this->dir.$name); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | public function restore(string $name): void |
33 | 33 | { |
34 | - file_put_contents($this->dir . $name, $this->storage[$name]); |
|
34 | + file_put_contents($this->dir.$name, $this->storage[$name]); |
|
35 | 35 | } |
36 | 36 | } |
@@ -57,12 +57,12 @@ |
||
57 | 57 | { |
58 | 58 | $line = 0; |
59 | 59 | |
60 | - for ($i = 0; $i < $offset; $i++) { |
|
61 | - if (!isset($content[$i])) { |
|
60 | + for ($i = 0; $i < $offset; $i++){ |
|
61 | + if (!isset($content[$i])){ |
|
62 | 62 | break; |
63 | 63 | } |
64 | 64 | |
65 | - if ($content[$i] === "\n") { |
|
65 | + if ($content[$i] === "\n"){ |
|
66 | 66 | $line++; |
67 | 67 | } |
68 | 68 | } |
@@ -57,12 +57,15 @@ |
||
57 | 57 | { |
58 | 58 | $line = 0; |
59 | 59 | |
60 | - for ($i = 0; $i < $offset; $i++) { |
|
61 | - if (!isset($content[$i])) { |
|
60 | + for ($i = 0; $i < $offset; $i++) |
|
61 | + { |
|
62 | + if (!isset($content[$i])) |
|
63 | + { |
|
62 | 64 | break; |
63 | 65 | } |
64 | 66 | |
65 | - if ($content[$i] === "\n") { |
|
67 | + if ($content[$i] === "\n") |
|
68 | + { |
|
66 | 69 | $line++; |
67 | 70 | } |
68 | 71 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | */ |
33 | 33 | public function load(string $path): Source |
34 | 34 | { |
35 | - if (!array_key_exists($path, $this->paths)) { |
|
35 | + if (!array_key_exists($path, $this->paths)){ |
|
36 | 36 | throw new LoaderException("Unable to load path `{$path}`"); |
37 | 37 | } |
38 | 38 |
@@ -32,7 +32,8 @@ |
||
32 | 32 | */ |
33 | 33 | public function load(string $path): Source |
34 | 34 | { |
35 | - if (!array_key_exists($path, $this->paths)) { |
|
35 | + if (!array_key_exists($path, $this->paths)) |
|
36 | + { |
|
36 | 37 | throw new LoaderException("Unable to load path `{$path}`"); |
37 | 38 | } |
38 | 39 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | $this->extension |
51 | 51 | ); |
52 | 52 | |
53 | - if (!file_exists($filename)) { |
|
53 | + if (!file_exists($filename)){ |
|
54 | 54 | throw new LoaderException("Unable to load `{$path}`, no such file"); |
55 | 55 | } |
56 | 56 |
@@ -50,7 +50,8 @@ |
||
50 | 50 | $this->extension |
51 | 51 | ); |
52 | 52 | |
53 | - if (!file_exists($filename)) { |
|
53 | + if (!file_exists($filename)) |
|
54 | + { |
|
54 | 55 | throw new LoaderException("Unable to load `{$path}`, no such file"); |
55 | 56 | } |
56 | 57 |