PHP Trait Webiny\Component\StdLib\FactoryLoaderTrait

Show file Open project: Webiny/Framework

Protected Methods

Method Description
factory ( string $className, string $classImplementation = '', array | null $arguments = null ) : mixed | string Create an instance of given $className.

Method Details

factory() protected static method

Create an instance of given $className.
protected static factory ( string $className, string $classImplementation = '', array | null $arguments = null ) : mixed | string
$className string Full class name, with namespace, of the class you wish to load.
$classImplementation string If you wish to validate that $className implements this $classImplementation, just pass full classified interface or class name here.
$arguments array | null A list of arguments passed to $className constructor.
return mixed | string