@@ -45,7 +45,7 @@ |
||
45 | 45 | /** |
46 | 46 | * Extract name from target entry. |
47 | 47 | * |
48 | - * @param $targetName |
|
48 | + * @param string $targetName |
|
49 | 49 | */ |
50 | 50 | public function aliasFromNamespace($targetName) |
51 | 51 | { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * @param string $name Entry name |
37 | 37 | * @param string $targetName Name of the target entry |
38 | 38 | */ |
39 | - public function __construct($name = null, $targetName = null) |
|
39 | + public function __construct ($name = null, $targetName = null) |
|
40 | 40 | { |
41 | 41 | $this->name = $name; |
42 | 42 | $this->targetName = $targetName; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * |
48 | 48 | * @param $targetName |
49 | 49 | */ |
50 | - public function aliasFromNamespace($targetName) |
|
50 | + public function aliasFromNamespace ($targetName) |
|
51 | 51 | { |
52 | 52 | $name = explode('\\', $targetName); |
53 | 53 | $name = end($name); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | /** |
59 | 59 | * @return string Entry name |
60 | 60 | */ |
61 | - public function getName() |
|
61 | + public function getName () |
|
62 | 62 | { |
63 | 63 | return $this->name; |
64 | 64 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | /** |
67 | 67 | * @return string Name of the target entry |
68 | 68 | */ |
69 | - public function getTargetName() |
|
69 | + public function getTargetName () |
|
70 | 70 | { |
71 | 71 | return $this->targetName; |
72 | 72 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | /** |
20 | 20 | * {@inheritdoc} |
21 | 21 | */ |
22 | - public function get($name) |
|
22 | + public function get ($name) |
|
23 | 23 | { |
24 | 24 | if ($this->has($name)) { |
25 | 25 | return $this->definitions[$name]; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * |
63 | 63 | * @return array |
64 | 64 | */ |
65 | - public function getParametersDefinition(\ReflectionFunctionAbstract $constructor) |
|
65 | + public function getParametersDefinition (\ReflectionFunctionAbstract $constructor) |
|
66 | 66 | { |
67 | 67 | $parameters = []; |
68 | 68 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * |
88 | 88 | * @return mixed|null|object |
89 | 89 | */ |
90 | - private function getClassDefinition(\ReflectionClass $parameterClass) |
|
90 | + private function getClassDefinition (\ReflectionClass $parameterClass) |
|
91 | 91 | { |
92 | 92 | $parameterClassName = $parameterClass->getName(); |
93 | 93 | $entryReference = new \ReflectionClass($parameterClass->getName()); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * |
50 | 50 | * @return array|null |
51 | 51 | */ |
52 | - public function getMethodParameters(\ReflectionMethod $method) |
|
52 | + public function getMethodParameters (\ReflectionMethod $method) |
|
53 | 53 | { |
54 | 54 | $methodComment = $method->getDocComment(); |
55 | 55 | if (!preg_match_all('/@param\s+([^\s\*\/]+)/', $methodComment, $matches)) { |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @return null|ObjectDefinition |
87 | 87 | */ |
88 | - public function getPropertyClass(\ReflectionProperty $property) |
|
88 | + public function getPropertyClass (\ReflectionProperty $property) |
|
89 | 89 | { |
90 | 90 | $propertyComment = $property->getDocComment(); |
91 | 91 | if (!preg_match('/@var\s+([^\s\(\*\/]+)/', $propertyComment, $matches)) { |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | * |
139 | 139 | * @return bool |
140 | 140 | */ |
141 | - private function classExists($className) |
|
141 | + private function classExists ($className) |
|
142 | 142 | { |
143 | 143 | return class_exists($className) || interface_exists($className); |
144 | 144 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | * |
149 | 149 | * @return int |
150 | 150 | */ |
151 | - private function namespaceExists($className) |
|
151 | + private function namespaceExists ($className) |
|
152 | 152 | { |
153 | 153 | return strpos($className, $this->namespace); |
154 | 154 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * |
161 | 161 | * @return string |
162 | 162 | */ |
163 | - protected static function parseValue($value) |
|
163 | + protected static function parseValue ($value) |
|
164 | 164 | { |
165 | 165 | $value = trim($value, ', '); |
166 | 166 | |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | * |
236 | 236 | * @return array|null |
237 | 237 | */ |
238 | - private function propertyClassParameters($property, $className) |
|
238 | + private function propertyClassParameters ($property, $className) |
|
239 | 239 | { |
240 | 240 | $classNamePosition = strpos($property, $className); |
241 | 241 | if ($classNamePosition !== false) { |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | * |
253 | 253 | * @param $namespace |
254 | 254 | */ |
255 | - public function setNamespace($namespace) |
|
255 | + public function setNamespace ($namespace) |
|
256 | 256 | { |
257 | 257 | $this->namespace = $namespace; |
258 | 258 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * |
31 | 31 | * @return mixed|null|object |
32 | 32 | */ |
33 | - public function get($name) |
|
33 | + public function get ($name) |
|
34 | 34 | { |
35 | 35 | if ($this->has($name)) { |
36 | 36 | return $this->definitions[$name]; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * |
58 | 58 | * @return PhpDocReader |
59 | 59 | */ |
60 | - private function getPhpDocReader() |
|
60 | + private function getPhpDocReader () |
|
61 | 61 | { |
62 | 62 | if ($this->phpDocReader === null) { |
63 | 63 | $this->phpDocReader = new PhpDocReader(); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * @param \ReflectionClass $class |
73 | 73 | * @param ObjectDefinition $object |
74 | 74 | */ |
75 | - private function readProperties(\ReflectionClass $class, ObjectDefinition $object) |
|
75 | + private function readProperties (\ReflectionClass $class, ObjectDefinition $object) |
|
76 | 76 | { |
77 | 77 | $namespace = $class->getNamespaceName(); |
78 | 78 | foreach ($class->getProperties() as $property) { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * |
104 | 104 | * @throws \Stack\DI\Exception\AnnotationException |
105 | 105 | */ |
106 | - private function setProperty(\ReflectionProperty $property, ObjectDefinition $objectDefinition, $namespace) |
|
106 | + private function setProperty (\ReflectionProperty $property, ObjectDefinition $objectDefinition, $namespace) |
|
107 | 107 | { |
108 | 108 | $this->getPhpDocReader()->setNamespace($namespace); |
109 | 109 | $propertyClass = $this->getPhpDocReader()->getPropertyClass($property); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * |
123 | 123 | * @return object|\ReflectionClass |
124 | 124 | */ |
125 | - private function setMethods(\ReflectionClass $class, ObjectDefinition $objectDefinition) |
|
125 | + private function setMethods (\ReflectionClass $class, ObjectDefinition $objectDefinition) |
|
126 | 126 | { |
127 | 127 | $isConstructor = false; |
128 | 128 | $methodName = []; |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | * |
167 | 167 | * @return array|null |
168 | 168 | */ |
169 | - private function getMethodParameters(\ReflectionMethod $method) |
|
169 | + private function getMethodParameters (\ReflectionMethod $method) |
|
170 | 170 | { |
171 | 171 | $annotationParameters = $this->getPhpDocReader()->getMethodParameters($method); |
172 | 172 | if ($annotationParameters !== null) { |
@@ -23,5 +23,5 @@ |
||
23 | 23 | * |
24 | 24 | * @return mixed|null|object |
25 | 25 | */ |
26 | - public function get($name); |
|
26 | + public function get ($name); |
|
27 | 27 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @param array $definitions |
28 | 28 | */ |
29 | - public function __construct(array $definitions) |
|
29 | + public function __construct (array $definitions) |
|
30 | 30 | { |
31 | 31 | $this->definitions = $definitions; |
32 | 32 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * |
37 | 37 | * @param array $definitions |
38 | 38 | */ |
39 | - public function add(array $definitions) |
|
39 | + public function add (array $definitions) |
|
40 | 40 | { |
41 | 41 | $this->definitions = array_merge($this->definitions, $definitions); |
42 | 42 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * |
50 | 50 | * @return bool |
51 | 51 | */ |
52 | - public function has($name) |
|
52 | + public function has ($name) |
|
53 | 53 | { |
54 | 54 | if (!is_string($name)) { |
55 | 55 | return false; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * @param $name |
65 | 65 | * @param $value |
66 | 66 | */ |
67 | - public function set($name, $value) |
|
67 | + public function set ($name, $value) |
|
68 | 68 | { |
69 | 69 | $this->definitions[$name] = $value; |
70 | 70 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @param string $name Entry name |
47 | 47 | * @param null $className Class name |
48 | 48 | */ |
49 | - public function __construct($name, $className = null) |
|
49 | + public function __construct ($name, $className = null) |
|
50 | 50 | { |
51 | 51 | $this->name = $name; |
52 | 52 | $this->className = $className; |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | /** |
56 | 56 | * @return string Class name |
57 | 57 | */ |
58 | - public function getClassName() |
|
58 | + public function getClassName () |
|
59 | 59 | { |
60 | 60 | if ($this->className !== null) { |
61 | 61 | return $this->className; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | /** |
68 | 68 | * @return string Entry name |
69 | 69 | */ |
70 | - public function getName() |
|
70 | + public function getName () |
|
71 | 71 | { |
72 | 72 | return $this->name; |
73 | 73 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * @param $name |
79 | 79 | * @param array $methodInjection |
80 | 80 | */ |
81 | - public function addMethodInjection($name, array $methodInjection) |
|
81 | + public function addMethodInjection ($name, array $methodInjection) |
|
82 | 82 | { |
83 | 83 | if (!isset($this->methodInjections[$name])) { |
84 | 84 | $this->methodInjections[$name] = []; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @param \ReflectionProperty $property |
94 | 94 | * @param $target |
95 | 95 | */ |
96 | - public function setPropertyInjection(\ReflectionProperty $property, $target) |
|
96 | + public function setPropertyInjection (\ReflectionProperty $property, $target) |
|
97 | 97 | { |
98 | 98 | if (!$property->isPublic()) { |
99 | 99 | $property->setAccessible(true); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | * |
107 | 107 | * @param array $methodInjection |
108 | 108 | */ |
109 | - public function setConstructorInjection(array $methodInjection) |
|
109 | + public function setConstructorInjection (array $methodInjection) |
|
110 | 110 | { |
111 | 111 | $this->constructorInjection = $methodInjection; |
112 | 112 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * |
119 | 119 | * @return array |
120 | 120 | */ |
121 | - public function getMethodParameters($name) |
|
121 | + public function getMethodParameters ($name) |
|
122 | 122 | { |
123 | 123 | if (isset($this->methodInjections[$name])) { |
124 | 124 | return $this->methodInjections[$name][0]; |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * |
135 | 135 | * @return object|\ReflectionClass |
136 | 136 | */ |
137 | - public function getNewInstance($withConstructor = true) |
|
137 | + public function getNewInstance ($withConstructor = true) |
|
138 | 138 | { |
139 | 139 | $object = new \ReflectionClass($this->name); |
140 | 140 |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @param DefinitionSourceInterface $definitionSource |
59 | 59 | * @param ContainerInterface $delegateContainer |
60 | 60 | */ |
61 | - public function __construct( |
|
61 | + public function __construct ( |
|
62 | 62 | DefinitionSourceInterface $definitionSource, |
63 | 63 | ContainerInterface $delegateContainer = null |
64 | 64 | ) { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * |
77 | 77 | * @return mixed Entry. |
78 | 78 | */ |
79 | - public function get($name) |
|
79 | + public function get ($name) |
|
80 | 80 | { |
81 | 81 | $service = $name; |
82 | 82 | $name = strtolower($name); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * |
117 | 117 | * @return bool |
118 | 118 | */ |
119 | - public function has($name) |
|
119 | + public function has ($name) |
|
120 | 120 | { |
121 | 121 | if (!is_string($name)) { |
122 | 122 | throw new \InvalidArgumentException(sprintf( |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * @param string $name Entry name |
141 | 141 | * @param mixed $value Value |
142 | 142 | */ |
143 | - public function set($name, $value) |
|
143 | + public function set ($name, $value) |
|
144 | 144 | { |
145 | 145 | $name = strtolower($name); |
146 | 146 | $isClosure = false; |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | * |
163 | 163 | * @return mixed |
164 | 164 | */ |
165 | - private function getAlias($name) |
|
165 | + private function getAlias ($name) |
|
166 | 166 | { |
167 | 167 | if (!$this->hasAlias($name)) { |
168 | 168 | throw new \InvalidArgumentException(sprintf('The service alias "%s" does not exist.', $name)); |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | * |
177 | 177 | * @return bool |
178 | 178 | */ |
179 | - private function hasAlias($name) |
|
179 | + private function hasAlias ($name) |
|
180 | 180 | { |
181 | 181 | return isset($this->aliasDefinitions[$name]); |
182 | 182 | } |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | /** |
185 | 185 | * @param string $name |
186 | 186 | */ |
187 | - private function setAlias($name) |
|
187 | + private function setAlias ($name) |
|
188 | 188 | { |
189 | 189 | $alias = new AliasDefinition(); |
190 | 190 | $alias->aliasFromNamespace($name); |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | * |
200 | 200 | * @return mixed |
201 | 201 | */ |
202 | - private function getServiceFromFactory($name) |
|
202 | + private function getServiceFromFactory ($name) |
|
203 | 203 | { |
204 | 204 | $serviceFactory = $this->serviceFactory[$name]; |
205 | 205 | $delegateContainer = $this->delegateContainer ?: $this; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * |
58 | 58 | * @param string $containerClass |
59 | 59 | */ |
60 | - public function __construct($containerClass = 'Stack\DI\Container') |
|
60 | + public function __construct ($containerClass = 'Stack\DI\Container') |
|
61 | 61 | { |
62 | 62 | $this->containerClass = $containerClass; |
63 | 63 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @return bool |
71 | 71 | */ |
72 | - public function addDefinitions(array $definitions) |
|
72 | + public function addDefinitions (array $definitions) |
|
73 | 73 | { |
74 | 74 | $this->definitionSources = $definitions; |
75 | 75 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * |
82 | 82 | * @return Container |
83 | 83 | */ |
84 | - public function build() |
|
84 | + public function build () |
|
85 | 85 | { |
86 | 86 | $definitionSource = null; |
87 | 87 | if ($this->useAnnotation) { |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * |
101 | 101 | * @return Container |
102 | 102 | */ |
103 | - public static function buildDevContainer() |
|
103 | + public static function buildDevContainer () |
|
104 | 104 | { |
105 | 105 | $builder = new self(); |
106 | 106 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * |
117 | 117 | * @return $this |
118 | 118 | */ |
119 | - public function useAutowiring($bool) |
|
119 | + public function useAutowiring ($bool) |
|
120 | 120 | { |
121 | 121 | $this->useAutowiring = $bool; |
122 | 122 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | * |
133 | 133 | * @return $this |
134 | 134 | */ |
135 | - public function useAnnotation($bool) |
|
135 | + public function useAnnotation ($bool) |
|
136 | 136 | { |
137 | 137 | $this->useAnnotation = $bool; |
138 | 138 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * |
147 | 147 | * @return $this |
148 | 148 | */ |
149 | - public function setDelegateContainer(ContainerInterface $delegateContainer) |
|
149 | + public function setDelegateContainer (ContainerInterface $delegateContainer) |
|
150 | 150 | { |
151 | 151 | $this->delegateContainer = $delegateContainer; |
152 | 152 |