@@ -26,7 +26,7 @@ |
||
26 | 26 | /** |
27 | 27 | * @param MethodCollection $methodCollection |
28 | 28 | * |
29 | - * @return array |
|
29 | + * @return string |
|
30 | 30 | */ |
31 | 31 | public function extract(MethodCollection $methodCollection) |
32 | 32 | { |
@@ -81,11 +81,11 @@ |
||
81 | 81 | $parameter = [ |
82 | 82 | 'name' => $reflectionProperty->getName(), |
83 | 83 | 'description' => $docBlock->getShortDescription(), |
84 | - 'type' => $type.($isCollection ? '[]' : ''), |
|
84 | + 'type' => $type . ($isCollection ? '[]' : ''), |
|
85 | 85 | ]; |
86 | 86 | if (class_exists($type)) { |
87 | 87 | $parameter = array_merge($parameter, [ |
88 | - 'type' => 'object'.($isCollection ? '[]' : ''), |
|
88 | + 'type' => 'object' . ($isCollection ? '[]' : ''), |
|
89 | 89 | 'properties' => $this->extractParameters($type, $processed), |
90 | 90 | ]); |
91 | 91 | } |
@@ -53,6 +53,9 @@ discard block |
||
53 | 53 | return $type . ($isCollection ? '[]' : ''); |
54 | 54 | } |
55 | 55 | |
56 | + /** |
|
57 | + * @param string $type |
|
58 | + */ |
|
56 | 59 | private function isTypeObject($type) |
57 | 60 | { |
58 | 61 | switch (strtolower($type)) { |
@@ -77,6 +80,9 @@ discard block |
||
77 | 80 | } |
78 | 81 | } |
79 | 82 | |
83 | + /** |
|
84 | + * @param string $type |
|
85 | + */ |
|
80 | 86 | private function resolveClassName($type, \ReflectionClass $usingClass) |
81 | 87 | { |
82 | 88 | if (strpos($type, '\\') === 0 && class_exists($type)) { |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $type = $this->resolveClassName($type, $reflectionProperty->getDeclaringClass()); |
53 | 53 | } |
54 | 54 | |
55 | - return $type.($isCollection ? '[]' : ''); |
|
55 | + return $type . ($isCollection ? '[]' : ''); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | private function isTypeObject($type) |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $alias = strtolower($type); |
94 | 94 | |
95 | 95 | if (!isset($aliases[$alias])) { |
96 | - return $usingClass->getNamespaceName().'\\'.$type; |
|
96 | + return $usingClass->getNamespaceName() . '\\' . $type; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | return $aliases[$alias]; |
@@ -118,6 +118,6 @@ discard block |
||
118 | 118 | $type = $this->resolveClassName($type, $reflectionFunction->getDeclaringClass()); |
119 | 119 | } |
120 | 120 | |
121 | - return $type.($isCollection ? '[]' : ''); |
|
121 | + return $type . ($isCollection ? '[]' : ''); |
|
122 | 122 | } |
123 | 123 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | { |
17 | 17 | $this->has('sampleService.sampleMethod')->shouldBe(false); |
18 | 18 | |
19 | - $this->add('sampleService.sampleMethod', function () {}); |
|
19 | + $this->add('sampleService.sampleMethod', function() {}); |
|
20 | 20 | |
21 | 21 | $this->get('sampleService.sampleMethod')->shouldBeAnInstanceOf(\Closure::class); |
22 | 22 | } |
@@ -72,7 +72,7 @@ |
||
72 | 72 | |
73 | 73 | $methodDispatcher |
74 | 74 | ->dispatch('calculator.calculateProfit', ['month' => 'January']) |
75 | - ->will(function () { |
|
75 | + ->will(function() { |
|
76 | 76 | throw new Exception("test", 32); |
77 | 77 | }) |
78 | 78 | ; |
@@ -15,7 +15,7 @@ |
||
15 | 15 | return new Generator( |
16 | 16 | new MetadataExtractor(new TypeResolver(new PhpParser())), |
17 | 17 | new \Twig_Environment(new \Twig_Loader_Filesystem([ |
18 | - __DIR__.'/Resources', |
|
18 | + __DIR__ . '/Resources', |
|
19 | 19 | ])) |
20 | 20 | ); |
21 | 21 | } |