Final Class Yiisoft\Yii\Event\CallableFactory
| Inheritance | Yiisoft\ |
|---|
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| create() | Create real callable listener from definition. | Yiisoft\ |
Method Details
| public mixed __construct ( \ | ||
| $container | \ |
|
public function __construct(
private readonly ContainerInterface $container,
) {}
Create real callable listener from definition.
| public callable create ( mixed $definition ) | ||
| $definition | mixed |
Definition to create listener from. |
| throws | Yiisoft\ |
Failed to create listener. |
|---|---|---|
| throws | \ |
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();
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.