@@ -84,6 +84,9 @@ discard block |
||
84 | 84 | return $this->reflection->getInterfaces(); |
85 | 85 | } |
86 | 86 | |
87 | + /** |
|
88 | + * @param string $name |
|
89 | + */ |
|
87 | 90 | public function getMethod($name) |
88 | 91 | { |
89 | 92 | return $this->reflection->getMethod($name); |
@@ -174,6 +177,9 @@ discard block |
||
174 | 177 | return $this->reflection->hasConstant($name); |
175 | 178 | } |
176 | 179 | |
180 | + /** |
|
181 | + * @param string $name |
|
182 | + */ |
|
177 | 183 | public function hasMethod($name) |
178 | 184 | { |
179 | 185 | if (!is_string($name)) { |
@@ -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 | }; |
@@ -7,7 +7,6 @@ |
||
7 | 7 | namespace DependencyInjection; |
8 | 8 | |
9 | 9 | use Psr\Container\ContainerInterface; |
10 | -use DependencyInjection\Exception\ContainerException; |
|
11 | 10 | use DependencyInjection\Exception\NotFoundException; |
12 | 11 | |
13 | 12 | class Container implements \ArrayAccess, ContainerInterface |
@@ -186,7 +186,7 @@ |
||
186 | 186 | throw Internal\Exception\ReflectionExceptionFactory::invalidArgument( |
187 | 187 | sprintf( |
188 | 188 | "Parameter 1 of %s must be an abstract class name which exists in resolved concrete stack.", |
189 | - __METHOD__ |
|
189 | + __METHOD__ |
|
190 | 190 | ) |
191 | 191 | ); |
192 | 192 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @param string $instance The class name. |
34 | 34 | * @param array $parameters List of needed class dependency. |
35 | - * @return object |
|
35 | + * @return callable |
|
36 | 36 | */ |
37 | 37 | public function make($instance, $parameters = []) |
38 | 38 | { |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | /** |
449 | 449 | * Determine if current reflection object has constructor. |
450 | 450 | * |
451 | - * @param \ReflectionClass $refl The current reflection class object. |
|
451 | + * @param Internal\ReflectionClassFactory $refl The current reflection class object. |
|
452 | 452 | * @return boolean |
453 | 453 | */ |
454 | 454 | protected function hasConstructor(Internal\ReflectionClassFactory $refl) |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | /** |
460 | 460 | * Determine if unresolvable class name has cloneable. |
461 | 461 | * |
462 | - * @param \ReflectionClass $refl The current reflection class object. |
|
462 | + * @param Internal\ReflectionClassFactory $refl The current reflection class object. |
|
463 | 463 | * @return boolean |
464 | 464 | */ |
465 | 465 | protected function isCloneable(Internal\ReflectionClassFactory $refl) |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | /** |
471 | 471 | * Determine if unresolvable class name has serializable. |
472 | 472 | * |
473 | - * @param \ReflectionClass $refl The current reflection class object. |
|
473 | + * @param Internal\ReflectionClassFactory $refl The current reflection class object. |
|
474 | 474 | * @return boolean |
475 | 475 | */ |
476 | 476 | protected function isSerializable(Internal\ReflectionClassFactory $refl) |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | /** |
482 | 482 | * Resolving class name without constructor. |
483 | 483 | * |
484 | - * @param \ReflectionClass $refl An instance of \ReflectionClass |
|
484 | + * @param Internal\ReflectionClassFactory $refl An instance of \ReflectionClass |
|
485 | 485 | */ |
486 | 486 | protected function resolveInstanceWithoutConstructor(Internal\ReflectionClassFactory $refl) |
487 | 487 | { |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | /** |
492 | 492 | * Get method parameters. |
493 | 493 | * |
494 | - * @param \ReflectionClass $refl An reflection class instance. |
|
494 | + * @param Internal\ReflectionClassFactory $refl An reflection class instance. |
|
495 | 495 | * @param string $method The method name. |
496 | 496 | * @return array |
497 | 497 | */ |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | * |
506 | 506 | * @param string $abstract The resolved class name. |
507 | 507 | * @param object $resolvedInstance The object instance of resolved abstract. |
508 | - * @param mixed $flag The concrete-resolving behavior. |
|
508 | + * @param string $flag The concrete-resolving behavior. |
|
509 | 509 | * @return void |
510 | 510 | */ |
511 | 511 | protected function markAsResolved($abstract, $resolvedInstance, $flag = []) |
@@ -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 | }); |