forked from tempestphp/highlight
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApacheFlagPattern.php
More file actions
31 lines (25 loc) · 871 Bytes
/
ApacheFlagPattern.php
File metadata and controls
31 lines (25 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
declare(strict_types=1);
namespace Tempest\Highlight\Languages\Apache\Patterns;
use Tempest\Highlight\IsPattern;
use Tempest\Highlight\Pattern;
use Tempest\Highlight\PatternTest;
use Tempest\Highlight\Tokens\TokenTypeEnum;
#[PatternTest(input: 'SSLEngine on', output: 'on')]
#[PatternTest(input: 'SSLEngine off', output: 'off')]
#[PatternTest(input: 'Options All', output: 'All')]
#[PatternTest(input: 'Options None', output: 'None')]
#[PatternTest(input: 'Require all granted', output: 'granted')]
#[PatternTest(input: 'Require all denied', output: 'denied')]
final readonly class ApacheFlagPattern implements Pattern
{
use IsPattern;
public function getPattern(): string
{
return '/\b(?<match>on|off|All|None|granted|denied)\b/';
}
public function getTokenType(): TokenTypeEnum
{
return TokenTypeEnum::VALUE;
}
}