@@ -199,6 +199,9 @@ |
||
| 199 | 199 | return $docBlock; |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | + /** |
|
| 203 | + * @param string $className |
|
| 204 | + */ |
|
| 202 | 205 | public function getImplemented($className) |
| 203 | 206 | { |
| 204 | 207 | $cacheKey = self::CACHE_KEY_IMPLEMENTED . strtolower($className); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | public function getClass($class) |
| 28 | 28 | { |
| 29 | - $cacheKey = self::CACHE_KEY_CLASSES . strtolower($class); |
|
| 29 | + $cacheKey = self::CACHE_KEY_CLASSES.strtolower($class); |
|
| 30 | 30 | |
| 31 | 31 | if (!$reflectionClass = $this->cache->fetch($cacheKey)) { |
| 32 | 32 | $reflectionClass = new ExtendedReflectionClass($class); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | public function getCtor($class) |
| 40 | 40 | { |
| 41 | - $cacheKey = self::CACHE_KEY_CTORS . strtolower($class); |
|
| 41 | + $cacheKey = self::CACHE_KEY_CTORS.strtolower($class); |
|
| 42 | 42 | |
| 43 | 43 | $reflectedCtor = $this->cache->fetch($cacheKey); |
| 44 | 44 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | public function getCtorParams($class) |
| 55 | 55 | { |
| 56 | - $cacheKey = self::CACHE_KEY_CTOR_PARAMS . strtolower($class); |
|
| 56 | + $cacheKey = self::CACHE_KEY_CTOR_PARAMS.strtolower($class); |
|
| 57 | 57 | |
| 58 | 58 | $reflectedCtorParams = $this->cache->fetch($cacheKey); |
| 59 | 59 | |
@@ -77,11 +77,11 @@ discard block |
||
| 77 | 77 | if ($function instanceof \ReflectionMethod) { |
| 78 | 78 | $lowClass = strtolower($function->class); |
| 79 | 79 | $lowMethod = strtolower($function->name); |
| 80 | - $paramCacheKey = self::CACHE_KEY_CLASSES . "{$lowClass}.{$lowMethod}.param-{$lowParam}"; |
|
| 80 | + $paramCacheKey = self::CACHE_KEY_CLASSES."{$lowClass}.{$lowMethod}.param-{$lowParam}"; |
|
| 81 | 81 | } else { |
| 82 | 82 | $lowFunc = strtolower($function->name); |
| 83 | 83 | $paramCacheKey = ($lowFunc !== '{closure}') |
| 84 | - ? self::CACHE_KEY_FUNCS . ".{$lowFunc}.param-{$lowParam}" |
|
| 84 | + ? self::CACHE_KEY_FUNCS.".{$lowFunc}.param-{$lowParam}" |
|
| 85 | 85 | : null; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | if ($reflectionClass = $param->getClass()) { |
| 95 | 95 | $typeHint = $reflectionClass->getName(); |
| 96 | - $classCacheKey = self::CACHE_KEY_CLASSES . strtolower($typeHint); |
|
| 96 | + $classCacheKey = self::CACHE_KEY_CLASSES.strtolower($typeHint); |
|
| 97 | 97 | $this->cache->store($classCacheKey, $this->getClass($param->getClass()->getName())); |
| 98 | 98 | } elseif (($docBlockParams = $this->getDocBlock($function)->getTagsByName('param')) && !empty($docBlockParams)) { |
| 99 | 99 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | // use first definition, there is no way to know which instance of the hinted doc block definitions is actually required |
| 129 | 129 | // because there were either no arguments given or no argument match was found |
| 130 | - list($typeHint, ) = $definitions; |
|
| 130 | + list($typeHint,) = $definitions; |
|
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | // store the ExtendedReflectionClass in the cache |
| 136 | 136 | if ($typeHint !== false) { |
| 137 | 137 | |
| 138 | - $classCacheKey = self::CACHE_KEY_CLASSES . strtolower($typeHint); |
|
| 138 | + $classCacheKey = self::CACHE_KEY_CLASSES.strtolower($typeHint); |
|
| 139 | 139 | $this->cache->store($classCacheKey, $this->getClass($typeHint)); |
| 140 | 140 | } |
| 141 | 141 | } else { |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | public function getFunction($functionName) |
| 151 | 151 | { |
| 152 | 152 | $lowFunc = strtolower($functionName); |
| 153 | - $cacheKey = self::CACHE_KEY_FUNCS . $lowFunc; |
|
| 153 | + $cacheKey = self::CACHE_KEY_FUNCS.$lowFunc; |
|
| 154 | 154 | |
| 155 | 155 | $reflectedFunc = $this->cache->fetch($cacheKey); |
| 156 | 156 | |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | ? $classNameOrInstance |
| 169 | 169 | : get_class($classNameOrInstance); |
| 170 | 170 | |
| 171 | - $cacheKey = self::CACHE_KEY_METHODS . strtolower($className) . '.' . strtolower($methodName); |
|
| 171 | + $cacheKey = self::CACHE_KEY_METHODS.strtolower($className).'.'.strtolower($methodName); |
|
| 172 | 172 | |
| 173 | 173 | if (!$reflectedMethod = $this->cache->fetch($cacheKey)) { |
| 174 | 174 | $reflectedMethod = new \ReflectionMethod($className, $methodName); |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | |
| 181 | 181 | public function getDocBlock(\ReflectionFunctionAbstract $method) |
| 182 | 182 | { |
| 183 | - $cacheKey = self::CACHE_KEY_DOC_BLOCK . strtolower($method->class); |
|
| 183 | + $cacheKey = self::CACHE_KEY_DOC_BLOCK.strtolower($method->class); |
|
| 184 | 184 | if (!$docBlock = $this->cache->fetch($cacheKey)) { |
| 185 | 185 | |
| 186 | 186 | $class = $this->getClass($method->class); |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | |
| 202 | 202 | public function getImplemented($className) |
| 203 | 203 | { |
| 204 | - $cacheKey = self::CACHE_KEY_IMPLEMENTED . strtolower($className); |
|
| 204 | + $cacheKey = self::CACHE_KEY_IMPLEMENTED.strtolower($className); |
|
| 205 | 205 | |
| 206 | 206 | if (!$implemented = $this->cache->fetch($cacheKey)) { |
| 207 | 207 | $implemented = array_merge([$className], class_implements($className)); |
@@ -100,6 +100,9 @@ |
||
| 100 | 100 | ); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | + /** |
|
| 104 | + * @param string $className |
|
| 105 | + */ |
|
| 103 | 106 | public function getImplemented($className) |
| 104 | 107 | { |
| 105 | 108 | return array_merge([$className], class_implements($className)); |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | |
| 63 | 63 | // use first definition, there is no way to know which instance of the hinted doc block definitions is actually required |
| 64 | 64 | // because there were either no arguments given or no argument match was found |
| 65 | - list($typeHint, ) = $definitions; |
|
| 65 | + list($typeHint,) = $definitions; |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | } |
@@ -477,13 +477,13 @@ discard block |
||
| 477 | 477 | } elseif (isset($definitions[$name]) || array_key_exists($name, $definitions)) { |
| 478 | 478 | // interpret the param as a class name to be instantiated |
| 479 | 479 | $arg = $this->make($definitions[$name]); |
| 480 | - } elseif (($prefix = self::A_RAW . $name) && (isset($definitions[$prefix]) || array_key_exists($prefix, $definitions))) { |
|
| 480 | + } elseif (($prefix = self::A_RAW.$name) && (isset($definitions[$prefix]) || array_key_exists($prefix, $definitions))) { |
|
| 481 | 481 | // interpret the param as a raw value to be injected |
| 482 | 482 | $arg = $definitions[$prefix]; |
| 483 | - } elseif (($prefix = self::A_DELEGATE . $name) && isset($definitions[$prefix])) { |
|
| 483 | + } elseif (($prefix = self::A_DELEGATE.$name) && isset($definitions[$prefix])) { |
|
| 484 | 484 | // interpret the param as an invokable delegate |
| 485 | 485 | $arg = $this->buildArgFromDelegate($name, $definitions[$prefix]); |
| 486 | - } elseif (($prefix = self::A_DEFINE . $name) && isset($definitions[$prefix])) { |
|
| 486 | + } elseif (($prefix = self::A_DEFINE.$name) && isset($definitions[$prefix])) { |
|
| 487 | 487 | // interpret the param as a class definition |
| 488 | 488 | $arg = $this->buildArgFromParamDefineArr($definitions[$prefix]); |
| 489 | 489 | } elseif (!$arg = $this->buildArgFromTypeHint($reflFunc, $reflParam)) { |
@@ -568,9 +568,9 @@ discard block |
||
| 568 | 568 | } else { |
| 569 | 569 | $reflFunc = $reflParam->getDeclaringFunction(); |
| 570 | 570 | $classWord = ($reflFunc instanceof \ReflectionMethod) |
| 571 | - ? $reflFunc->getDeclaringClass()->name . '::' |
|
| 571 | + ? $reflFunc->getDeclaringClass()->name.'::' |
|
| 572 | 572 | : ''; |
| 573 | - $funcWord = $classWord . $reflFunc->name; |
|
| 573 | + $funcWord = $classWord.$reflFunc->name; |
|
| 574 | 574 | |
| 575 | 575 | throw new InjectionException( |
| 576 | 576 | $this->inProgressMakes, |