@@ -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 | } |
@@ -13,12 +13,12 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public static function getParams(string $method): array |
| 15 | 15 | { |
| 16 | - try { |
|
| 16 | + try{ |
|
| 17 | 17 | $rc = new \ReflectionClass(self::class); |
| 18 | 18 | $method = $rc->getMethod($method); |
| 19 | 19 | |
| 20 | 20 | return $method->getParameters(); |
| 21 | - } catch (\ReflectionException $e) { |
|
| 21 | + }catch (\ReflectionException $e){ |
|
| 22 | 22 | return []; |
| 23 | 23 | } |
| 24 | 24 | } |
@@ -13,12 +13,15 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public static function getParams(string $method): array |
| 15 | 15 | { |
| 16 | - try { |
|
| 16 | + try |
|
| 17 | + { |
|
| 17 | 18 | $rc = new \ReflectionClass(self::class); |
| 18 | 19 | $method = $rc->getMethod($method); |
| 19 | 20 | |
| 20 | 21 | return $method->getParameters(); |
| 21 | - } catch (\ReflectionException $e) { |
|
| 22 | + } |
|
| 23 | + catch (\ReflectionException $e) |
|
| 24 | + { |
|
| 22 | 25 | return []; |
| 23 | 26 | } |
| 24 | 27 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | $cd = ClassNode::create('class\name'); |
| 28 | 28 | $cd->constructorVars = $vars; |
| 29 | 29 | |
| 30 | - foreach (Fixtures\Params::getParams($method) as $param) { |
|
| 30 | + foreach (Fixtures\Params::getParams($method) as $param){ |
|
| 31 | 31 | $cd->addParam($param); |
| 32 | 32 | } |
| 33 | 33 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | $this->names()->resolve($cd); |
| 36 | 36 | |
| 37 | 37 | $resolved = []; |
| 38 | - foreach ($cd->dependencies as $dependency) { |
|
| 38 | + foreach ($cd->dependencies as $dependency){ |
|
| 39 | 39 | $resolved[] = $dependency->var; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | [ |
| 49 | 49 | 'paramsSource', |
| 50 | 50 | [], |
| 51 | - ['v2' => 'type1', 'v' => 'type2', 'vv' => 'type3',], |
|
| 51 | + ['v2' => 'type1', 'v' => 'type2', 'vv' => 'type3', ], |
|
| 52 | 52 | ['v2', 'v', 'vv'] |
| 53 | 53 | ], |
| 54 | 54 | [ |
@@ -27,7 +27,8 @@ discard block |
||
| 27 | 27 | $cd = ClassNode::create('class\name'); |
| 28 | 28 | $cd->constructorVars = $vars; |
| 29 | 29 | |
| 30 | - foreach (Fixtures\Params::getParams($method) as $param) { |
|
| 30 | + foreach (Fixtures\Params::getParams($method) as $param) |
|
| 31 | + { |
|
| 31 | 32 | $cd->addParam($param); |
| 32 | 33 | } |
| 33 | 34 | |
@@ -35,7 +36,8 @@ discard block |
||
| 35 | 36 | $this->names()->resolve($cd); |
| 36 | 37 | |
| 37 | 38 | $resolved = []; |
| 38 | - foreach ($cd->dependencies as $dependency) { |
|
| 39 | + foreach ($cd->dependencies as $dependency) |
|
| 40 | + { |
|
| 39 | 41 | $resolved[] = $dependency->var; |
| 40 | 42 | } |
| 41 | 43 | |
@@ -25,11 +25,11 @@ discard block |
||
| 25 | 25 | { |
| 26 | 26 | $cd = ClassNode::create('class\name'); |
| 27 | 27 | |
| 28 | - foreach ($stmts as $alias => $name) { |
|
| 28 | + foreach ($stmts as $alias => $name){ |
|
| 29 | 29 | $cd->addImportUsage($name, $alias); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - foreach (Fixtures\Params::getParams('paramsSource') as $param) { |
|
| 32 | + foreach (Fixtures\Params::getParams('paramsSource') as $param){ |
|
| 33 | 33 | $cd->addParam($param); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $this->namespaces()->resolve($cd); |
| 38 | 38 | |
| 39 | 39 | $resolved = []; |
| 40 | - foreach ($cd->dependencies as $dependency) { |
|
| 40 | + foreach ($cd->dependencies as $dependency){ |
|
| 41 | 41 | $resolved[$dependency->property] = $dependency->type->getAliasOrShortName(); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -25,11 +25,13 @@ discard block |
||
| 25 | 25 | { |
| 26 | 26 | $cd = ClassNode::create('class\name'); |
| 27 | 27 | |
| 28 | - foreach ($stmts as $alias => $name) { |
|
| 28 | + foreach ($stmts as $alias => $name) |
|
| 29 | + { |
|
| 29 | 30 | $cd->addImportUsage($name, $alias); |
| 30 | 31 | } |
| 31 | 32 | |
| 32 | - foreach (Fixtures\Params::getParams('paramsSource') as $param) { |
|
| 33 | + foreach (Fixtures\Params::getParams('paramsSource') as $param) |
|
| 34 | + { |
|
| 33 | 35 | $cd->addParam($param); |
| 34 | 36 | } |
| 35 | 37 | |
@@ -37,7 +39,8 @@ discard block |
||
| 37 | 39 | $this->namespaces()->resolve($cd); |
| 38 | 40 | |
| 39 | 41 | $resolved = []; |
| 40 | - foreach ($cd->dependencies as $dependency) { |
|
| 42 | + foreach ($cd->dependencies as $dependency) |
|
| 43 | + { |
|
| 41 | 44 | $resolved[$dependency->property] = $dependency->type->getAliasOrShortName(); |
| 42 | 45 | } |
| 43 | 46 | |
@@ -64,7 +64,8 @@ |
||
| 64 | 64 | $c->bindSingleton(TestClass::class, $t); |
| 65 | 65 | $p->bindProperty('testClass', TestClass::class); |
| 66 | 66 | |
| 67 | - $r = ContainerScope::runScope($c, static function () use ($t) { |
|
| 67 | + $r = ContainerScope::runScope($c, static function () use ($t) |
|
| 68 | + { |
|
| 68 | 69 | return $t->getTest(); |
| 69 | 70 | }); |
| 70 | 71 | |
@@ -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 | |
@@ -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'], |