Final Class Yiisoft\Yii\Runner\BootstrapRunner
| Inheritance | Yiisoft\Yii\Runner\BootstrapRunner |
|---|---|
| Implements | Yiisoft\Yii\Runner\RunnerInterface |
Runs application bootstrap configs.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\Yii\Runner\BootstrapRunner | |
| run() | Yiisoft\Yii\Runner\BootstrapRunner |
Method Details
| public mixed __construct ( \Psr\Container\ContainerInterface $container, array $bootstrapList = [] ) | ||
| $container | \Psr\Container\ContainerInterface | |
| $bootstrapList | array | |
public function __construct(
private ContainerInterface $container,
private array $bootstrapList = [],
) {
}
| public void run ( ) | ||
| throws | RuntimeException |
If the bootstrap callback is not callable. |
|---|---|---|
public function run(): void
{
foreach ($this->bootstrapList as $callback) {
if (!is_callable($callback)) {
throw new RuntimeException(
sprintf(
'Bootstrap callback must be callable, "%s" given.',
get_debug_type($callback),
)
);
}
$callback($this->container);
}
}
Signup or Login in order to comment.