@@ 233-247 (lines=15) @@ | ||
230 | * See https://github.com/rdlowrey/atreyu#injecting-for-execution |
|
231 | * @return self |
|
232 | */ |
|
233 | public function prepare($name, $callableOrMethodStr) |
|
234 | { |
|
235 | if ($this->isExecutable($callableOrMethodStr) === false) { |
|
236 | throw InjectionException::fromInvalidCallable( |
|
237 | $this->inProgressMakes, |
|
238 | self::E_INVOKABLE, |
|
239 | $callableOrMethodStr |
|
240 | ); |
|
241 | } |
|
242 | ||
243 | list(, $normalizedName) = $this->resolveAlias($name); |
|
244 | $this->prepares[$normalizedName] = $callableOrMethodStr; |
|
245 | ||
246 | return $this; |
|
247 | } |
|
248 | ||
249 | private function isExecutable($exe) |
|
250 | { |
|
@@ 545-557 (lines=13) @@ | ||
542 | return $this->make($class, $definition); |
|
543 | } |
|
544 | ||
545 | private function buildArgFromDelegate($paramName, $callableOrMethodStr) |
|
546 | { |
|
547 | if ($this->isExecutable($callableOrMethodStr) === false) { |
|
548 | throw InjectionException::fromInvalidCallable( |
|
549 | $this->inProgressMakes, |
|
550 | $callableOrMethodStr |
|
551 | ); |
|
552 | } |
|
553 | ||
554 | $executable = $this->buildExecutable($callableOrMethodStr); |
|
555 | ||
556 | return $executable($paramName, $this); |
|
557 | } |
|
558 | ||
559 | private function buildArgFromTypeHint(\ReflectionFunctionAbstract $reflFunc, \ReflectionParameter $reflParam) |
|
560 | { |