Final Class Yiisoft\Yii\Debug\StartupPolicy\Condition\CommandNameCondition
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| match() | Yiisoft\ |
Method Details
| public mixed __construct ( array $names ) | ||
| $names | array | |
public function __construct(
/**
* @var string[]
* @psalm-var list<non-empty-string>
*/
private readonly array $names,
) {}
| public boolean match ( object $event ) | ||
| $event | object | |
public function match(object $event): bool
{
if (!$event instanceof ApplicationStartup) {
return false;
}
$name = (string) $event->commandName;
foreach ($this->names as $pattern) {
if ((new WildcardPattern($pattern, [':']))->match($name)) {
return true;
}
}
return false;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.