0 follower

Final Class Yiisoft\Yii\Debug\StartupPolicy\Condition\UriPathCondition

InheritanceYiisoft\Yii\Debug\StartupPolicy\Condition\UriPathCondition
ImplementsYiisoft\Yii\Debug\StartupPolicy\Condition\ConditionInterface

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( array $paths )
$paths array

                public function __construct(
    /**
     * @var string[]
     * @psalm-var list<non-empty-string>
     */
    private readonly array $paths,
) {
}

            
match() public method

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;
}