1 | <?php |
||
20 | class AllowParser implements ParserInterface, RobotsTxtInterface |
||
21 | { |
||
22 | /** |
||
23 | * Directive |
||
24 | * @var string |
||
25 | */ |
||
26 | private $directive; |
||
27 | |||
28 | /** |
||
29 | * Path |
||
30 | * @var array |
||
31 | */ |
||
32 | private $path = []; |
||
33 | |||
34 | /** |
||
35 | * Sort result |
||
36 | * @var bool |
||
37 | */ |
||
38 | private $sort = false; |
||
39 | |||
40 | /** |
||
41 | * AllowParser constructor |
||
42 | * |
||
43 | * @param string $directive |
||
44 | */ |
||
45 | public function __construct($directive) |
||
49 | |||
50 | /** |
||
51 | * Add |
||
52 | * |
||
53 | * @param string $line |
||
54 | * @return bool |
||
55 | */ |
||
56 | public function add($line) |
||
67 | |||
68 | /** |
||
69 | * Normalize rules |
||
70 | * |
||
71 | * @param $line |
||
72 | * @return string |
||
73 | */ |
||
74 | private function normalize($line) |
||
88 | |||
89 | /** |
||
90 | * Render |
||
91 | * |
||
92 | * @param RenderHandler $handler |
||
93 | * @return bool |
||
94 | */ |
||
95 | public function render(RenderHandler $handler) |
||
110 | |||
111 | /** |
||
112 | * Sort by length |
||
113 | * |
||
114 | * @return bool |
||
115 | */ |
||
116 | private function sort() |
||
126 | |||
127 | /** |
||
128 | * Client |
||
129 | * |
||
130 | * @return AllowClient |
||
131 | */ |
||
132 | public function client() |
||
137 | } |
||
138 |