Final Class Yiisoft\Yii\Debug\StartupPolicy\Condition\UriPathCondition
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| match() | Yiisoft\ |
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;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.