| 1 | <?php |
||
| 12 | class StatusCodeParser implements RobotsTxtInterface |
||
| 13 | { |
||
| 14 | use DirectiveParserCommons; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Status code |
||
| 18 | * @var int |
||
| 19 | */ |
||
| 20 | private $code; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Scheme |
||
| 24 | * @var string|false |
||
| 25 | */ |
||
| 26 | private $scheme; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Constructor |
||
| 30 | * |
||
| 31 | * @param int|null $code - HTTP status code |
||
| 32 | * @param string|false $scheme |
||
| 33 | */ |
||
| 34 | public function __construct($code, $scheme) |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Validate |
||
| 42 | * |
||
| 43 | * @return bool |
||
| 44 | */ |
||
| 45 | public function isValid() |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Check if the code overrides the robots.txt file |
||
| 55 | * |
||
| 56 | * @return string|false |
||
| 57 | */ |
||
| 58 | public function accessOverride() |
||
| 71 | } |
||
| 72 |