public static function tryCreate(\ReflectionParameter $parameter, $overridenValue) { if (($parameterType = self::getParameterTypeFromDoc($parameter)) === null) { return null; } $target = $overridenValue instanceof NParameter ? $overridenValue : $parameterType; return new StandardParameter($target, $parameter, DirectTransformer::def()); }
public static function tryCreate(\ReflectionParameter $parameter, $overridenValue) { $parameterClass = $parameter->getClass(); if (!$parameterClass) { return null; } $target = $overridenValue instanceof NParameter ? $overridenValue : '\\' . $parameterClass->getName(); return new TypedParameter($target, $parameter, DirectTransformer::def()); }
private function refineDirectTransformer($id) { foreach ($this->getTransformerTypes() as $transformerType) { $transformerClass = '\\Conpago\\DI\\Transformers\\' . $transformerType . 'Transformer'; if (($parsed = $transformerClass::tryParseTarget($id)) !== null) { return $parsed; } } return (object) array('innerId' => $id, 'transformer' => DirectTransformer::def()); }
private function resolve() { $this->instance = $this->getTarget()->resolve($this->getContainer(), Transformers\DirectTransformer::def(), array()); $this->isResolved = true; }
public function resolveAll($type, $optionalParameters = null) { return $this->repository->resolveAllWith($type, DirectTransformer::def(), array_slice(func_get_args(), 1)); }
public function resolve(IResolver $container) { return $container->resolveWith('Name: ' . $this->targetName, DirectTransformer::def()); }
/** * Resolves object from container and return instance * * @return null|object */ public function createInstance() { $args = func_get_args(); return $this->getTarget()->resolve($this->getContainer(), DirectTransformer::def(), $args); }