Definition at line 19 of file Injector.php.
◆ __construct()
◆ createConstructorArguments()
ILIAS\BackgroundTasks\Dependencies\Injector::createConstructorArguments |
( |
|
$fullyQualifiedClassName, |
|
|
|
$parameters, |
|
|
|
$with |
|
) |
| |
|
protected |
◆ createInstance()
ILIAS\BackgroundTasks\Dependencies\Injector::createInstance |
( |
|
$fullyQualifiedClassName, |
|
|
|
$requireFile = false , |
|
|
callable |
$with = null |
|
) |
| |
- Parameters
-
| $fullyQualifiedClassName | string The given class must type hint all its constructor arguments. Furthermore the types must exist in the DI-Container. |
bool | $requireFile | |
- Returns
- object
PhpIncludeInspection
Definition at line 54 of file Injector.php.
References ILIAS\BackgroundTasks\Dependencies\Injector\createConstructorArguments().
57 require_once($requireFile);
61 $reflectionClass = new \ReflectionClass($fullyQualifiedClassName);
62 $constructor = $reflectionClass->getConstructor();
64 return $reflectionClass->newInstance();
67 $parameters = $constructor->getParameters();
73 return $reflectionClass->newInstanceArgs($constructorArguments);
createConstructorArguments($fullyQualifiedClassName, $parameters, $with)
◆ getDependency()
ILIAS\BackgroundTasks\Dependencies\Injector::getDependency |
( |
|
$fullyQualifiedClassName, |
|
|
|
$parameter, |
|
|
callable |
$with = null |
|
) |
| |
|
protected |
- Parameters
-
| $fullyQualifiedClassName | string |
| $parameter | ReflectionParameter |
callable | $with | |
- Returns
- mixed
- Exceptions
-
Definition at line 106 of file Injector.php.
References $type.
Referenced by ILIAS\BackgroundTasks\Dependencies\Injector\createConstructorArguments().
114 $type = $parameter->getClass()->getName();
121 throw new InvalidClassException(
"The DI cannot instantiate $fullyQualifiedClassName because some of the constructors arguments are not type hinted. Make sure all parameters in the constructor have type hinting.");
125 return $this->dependencyMap->getDependencyWith($this->dic,
$type, $fullyQualifiedClassName, $with);
127 return $this->dependencyMap->getDependency($this->dic,
$type, $fullyQualifiedClassName);
◆ $dependencyMap
ILIAS\BackgroundTasks\Dependencies\Injector::$dependencyMap |
|
protected |
◆ $dic
ILIAS\BackgroundTasks\Dependencies\Injector::$dic |
|
protected |
The documentation for this class was generated from the following file: