@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * |
| 26 | 26 | * @param string $instance The class name. |
| 27 | 27 | * @param array $parameters List of needed class dependency. |
| 28 | - * @return object |
|
| 28 | + * @return callable |
|
| 29 | 29 | */ |
| 30 | 30 | public function make($instance, $parameters = []) |
| 31 | 31 | { |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | /** |
| 94 | 94 | * Determine if concrete dependency is exists. |
| 95 | 95 | * |
| 96 | - * @param mixed $concrete The concrete dependency. |
|
| 96 | + * @param \Closure $concrete The concrete dependency. |
|
| 97 | 97 | * @return bool |
| 98 | 98 | */ |
| 99 | 99 | public function isConcreteExists($concrete) |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | /** |
| 272 | 272 | * Determine if current reflection object has constructor. |
| 273 | 273 | * |
| 274 | - * @param \ReflectionClass $refl The current reflection class object. |
|
| 274 | + * @param Internal\ReflectionClassFactory $refl The current reflection class object. |
|
| 275 | 275 | * @return boolean |
| 276 | 276 | */ |
| 277 | 277 | protected function hasConstructor(Internal\ReflectionClassFactory $refl) |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | /** |
| 283 | 283 | * Determine if unresolvable class name has cloneable. |
| 284 | 284 | * |
| 285 | - * @param \ReflectionClass $refl The current reflection class object. |
|
| 285 | + * @param Internal\ReflectionClassFactory $refl The current reflection class object. |
|
| 286 | 286 | * @return boolean |
| 287 | 287 | */ |
| 288 | 288 | protected function isCloneable(Internal\ReflectionClassFactory $refl) |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | /** |
| 294 | 294 | * Determine if unresolvable class name has serializable. |
| 295 | 295 | * |
| 296 | - * @param \ReflectionClass $refl The current reflection class object. |
|
| 296 | + * @param Internal\ReflectionClassFactory $refl The current reflection class object. |
|
| 297 | 297 | * @return boolean |
| 298 | 298 | */ |
| 299 | 299 | protected function isSerializable(Internal\ReflectionClassFactory $refl) |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | /** |
| 305 | 305 | * Resolving class name without constructor. |
| 306 | 306 | * |
| 307 | - * @param \ReflectionClass $refl An instance of \ReflectionClass |
|
| 307 | + * @param Internal\ReflectionClassFactory $refl An instance of \ReflectionClass |
|
| 308 | 308 | */ |
| 309 | 309 | protected function resolveInstanceWithoutConstructor(Internal\ReflectionClassFactory $refl) |
| 310 | 310 | { |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | /** |
| 315 | 315 | * Get method parameters. |
| 316 | 316 | * |
| 317 | - * @param \ReflectionClass $refl An reflection class instance. |
|
| 317 | + * @param Internal\ReflectionClassFactory $refl An reflection class instance. |
|
| 318 | 318 | * @param string $method The method name. |
| 319 | 319 | * @return array |
| 320 | 320 | */ |
@@ -413,7 +413,7 @@ |
||
| 413 | 413 | */ |
| 414 | 414 | protected function turnIntoResolvableClosure($abstract, $concrete) |
| 415 | 415 | { |
| 416 | - return function (Container $container, $parameters = []) use ($abstract, $concrete) { |
|
| 416 | + return function(Container $container, $parameters = []) use ($abstract, $concrete) { |
|
| 417 | 417 | return ($abstract == $concrete ? $container->resolve($abstract) |
| 418 | 418 | : $container->resolve($concrete, $parameters)); |
| 419 | 419 | }; |
@@ -3,19 +3,19 @@ |
||
| 3 | 3 | @trigger_error("This autoloader just for dummy testing. Just run 'composer dump-autoload --optimize' and you're set.", E_USER_DEPRECATED); |
| 4 | 4 | |
| 5 | 5 | \spl_autoload_register(function($className) { |
| 6 | - $rootDir = __DIR__ . DIRECTORY_SEPARATOR . 'src'; |
|
| 6 | + $rootDir = __DIR__ . DIRECTORY_SEPARATOR . 'src'; |
|
| 7 | 7 | |
| 8 | - $namespace = 'DependencyInjection'; |
|
| 8 | + $namespace = 'DependencyInjection'; |
|
| 9 | 9 | |
| 10 | - $className = str_replace( |
|
| 11 | - '\\', |
|
| 12 | - DIRECTORY_SEPARATOR, |
|
| 13 | - str_replace($namespace, $rootDir, $className) |
|
| 14 | - ); |
|
| 10 | + $className = str_replace( |
|
| 11 | + '\\', |
|
| 12 | + DIRECTORY_SEPARATOR, |
|
| 13 | + str_replace($namespace, $rootDir, $className) |
|
| 14 | + ); |
|
| 15 | 15 | |
| 16 | - $className .= '.php'; |
|
| 16 | + $className .= '.php'; |
|
| 17 | 17 | |
| 18 | - if ($file = stream_resolve_include_path($className)) { |
|
| 19 | - require_once $file; |
|
| 20 | - } |
|
| 18 | + if ($file = stream_resolve_include_path($className)) { |
|
| 19 | + require_once $file; |
|
| 20 | + } |
|
| 21 | 21 | }); |
@@ -24,6 +24,9 @@ discard block |
||
| 24 | 24 | $this->reflection = new \ReflectionClass($instance); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | + /** |
|
| 28 | + * @param string $instance |
|
| 29 | + */ |
|
| 27 | 30 | public static function create($instance) |
| 28 | 31 | { |
| 29 | 32 | return new static($instance); |
@@ -84,6 +87,9 @@ discard block |
||
| 84 | 87 | return $this->reflection->getInterfaces(); |
| 85 | 88 | } |
| 86 | 89 | |
| 90 | + /** |
|
| 91 | + * @param string $name |
|
| 92 | + */ |
|
| 87 | 93 | public function getMethod($name) |
| 88 | 94 | { |
| 89 | 95 | return $this->reflection->getMethod($name); |
@@ -174,6 +180,9 @@ discard block |
||
| 174 | 180 | return $this->reflection->hasConstant($name); |
| 175 | 181 | } |
| 176 | 182 | |
| 183 | + /** |
|
| 184 | + * @param string $name |
|
| 185 | + */ |
|
| 177 | 186 | public function hasMethod($name) |
| 178 | 187 | { |
| 179 | 188 | if (!is_string($name)) { |