| 1 | <?php |
||
| 11 | class RequestRateParser implements ParserInterface, RobotsTxtInterface |
||
| 12 | { |
||
| 13 | use DirectiveParserCommons; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Directive |
||
| 17 | */ |
||
| 18 | const DIRECTIVE = self::DIRECTIVE_REQUEST_RATE; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * RequestRate array |
||
| 22 | * @var array |
||
| 23 | */ |
||
| 24 | private $array = []; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * RequestRate constructor. |
||
| 28 | */ |
||
| 29 | public function __construct() |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Add |
||
| 35 | * |
||
| 36 | * @param string $line |
||
| 37 | * @return bool |
||
| 38 | */ |
||
| 39 | public function add($line) |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Export rules |
||
| 59 | * |
||
| 60 | * @return string[][] |
||
| 61 | */ |
||
| 62 | public function export() |
||
| 66 | |||
| 67 | /** |
||
| 68 | * Render |
||
| 69 | * |
||
| 70 | * @return string[] |
||
| 71 | */ |
||
| 72 | public function render() |
||
| 87 | } |
||
| 88 |