1 | <?php |
||
18 | class StatusCodeParser implements RobotsTxtInterface |
||
19 | { |
||
20 | /** |
||
21 | * Status code |
||
22 | * @var int |
||
23 | */ |
||
24 | private $code; |
||
25 | |||
26 | /** |
||
27 | * Scheme |
||
28 | * @var string|false |
||
29 | */ |
||
30 | private $scheme; |
||
31 | |||
32 | /** |
||
33 | * Constructor |
||
34 | * |
||
35 | * @param int|null $code - HTTP status code |
||
36 | * @param string|false $scheme |
||
37 | */ |
||
38 | public function __construct($code, $scheme) |
||
43 | |||
44 | /** |
||
45 | * Validate |
||
46 | * |
||
47 | * @return bool |
||
48 | */ |
||
49 | public function isValid() |
||
56 | |||
57 | /** |
||
58 | * Check if the code overrides the robots.txt file |
||
59 | * |
||
60 | * @link https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt#handling-http-result-codes |
||
61 | * @link https://yandex.com/support/webmaster/controlling-robot/robots-txt.xml#additional-info |
||
62 | * |
||
63 | * @return string|false |
||
64 | */ |
||
65 | public function accessOverride() |
||
78 | } |
||
79 |