0 follower

Final Class Yiisoft\Yii\Event\CallableFactory

InheritanceYiisoft\Yii\Event\CallableFactory

Public Methods

Hide inherited methods

Method Description Defined By
__construct() Yiisoft\Yii\Event\CallableFactory
create() Create real callable listener from definition. Yiisoft\Yii\Event\CallableFactory

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( \Psr\Container\ContainerInterface $container )
$container \Psr\Container\ContainerInterface

                public function __construct(
    private readonly ContainerInterface $container
) {
}

            
create() public method

Create real callable listener from definition.

public callable create ( mixed $definition )
$definition mixed

Definition to create listener from.

throws Yiisoft\Yii\Event\InvalidListenerConfigurationException

Failed to create listener.

throws \Psr\Container\ContainerExceptionInterface

Error while retrieving the entry from container.

                public function create(mixed $definition): callable
{
    $callable = $this->prepare($definition);
    if (is_callable($callable)) {
        return $callable;
    }
    throw new InvalidListenerConfigurationException();
}