Final Class Yiisoft\Yii\Debug\StartupPolicy\Condition\HeaderCondition
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| match() | Yiisoft\ |
Constants
| Constant | Value | Description | Defined By |
|---|---|---|---|
| TRUE_VALUES | [ '1', 'true', 'on', ] | Yiisoft\ |
Method Details
| public mixed __construct ( string $headerName ) | ||
| $headerName | string | |
public function __construct(
/**
* @psalm-var non-empty-string
*/
private readonly string $headerName,
) {}
| public boolean match ( object $event ) | ||
| $event | object | |
public function match(object $event): bool
{
if (!$event instanceof BeforeRequest) {
return false;
}
$request = $event->getRequest();
return $request->hasHeader($this->headerName)
&& in_array(strtolower($request->getHeaderLine($this->headerName)), self::TRUE_VALUES, true);
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.