Final Class Yiisoft\Yii\Debug\StartupPolicy\Condition\UriPathCondition
| Inheritance | Yiisoft\Yii\Debug\StartupPolicy\Condition\UriPathCondition |
|---|---|
| Implements | Yiisoft\Yii\Debug\StartupPolicy\Condition\ConditionInterface |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\Yii\Debug\StartupPolicy\Condition\UriPathCondition | |
| match() | Yiisoft\Yii\Debug\StartupPolicy\Condition\UriPathCondition |
Method Details
| public mixed __construct ( array $paths ) | ||
| $paths | array | |
public function __construct(
/**
* @var string[]
* @psalm-var list<non-empty-string>
*/
private readonly array $paths,
) {
}
| public boolean match ( object $event ) | ||
| $event | object | |
public function match(object $event): bool
{
if (!$event instanceof BeforeRequest) {
return false;
}
$path = $event->getRequest()->getUri()->getPath();
foreach ($this->paths as $pattern) {
if ((new WildcardPattern($pattern, ['/']))->match($path)) {
return true;
}
}
return false;
}
Signup or Login in order to comment.