1 | <?php |
||
7 | class RobotsHeaders |
||
8 | { |
||
9 | protected $robotHeadersProperties = []; |
||
10 | |||
11 | public static function readFrom(string $source): self |
||
21 | |||
22 | public static function create(array $headers): self |
||
23 | { |
||
24 | return new self($headers); |
||
25 | } |
||
26 | |||
27 | public function __construct(array $headers) |
||
28 | { |
||
29 | $this->robotHeadersProperties = $this->parseHeaders($headers); |
||
30 | } |
||
31 | |||
32 | public function mayIndex(string $userAgent = '*'): bool |
||
36 | |||
37 | public function mayFollow(string $userAgent = '*'): bool |
||
41 | |||
42 | public function noindex(string $userAgent = '*'): bool |
||
46 | |||
47 | public function nofollow(string $userAgent = '*'): bool |
||
51 | |||
52 | protected function parseHeaders(array $headers): array |
||
53 | { |
||
75 | |||
76 | protected function filterRobotHeaders(array $headers): array |
||
84 | |||
85 | protected function normalizeHeaders($headers): string |
||
89 | } |
||
90 |