| 1 | <?php |
||
| 12 | class CommentParser implements ParserInterface, RobotsTxtInterface |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * User-agent |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | private $userAgent; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Base Uri |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | private $base; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Comment array |
||
| 28 | * @var string[] |
||
| 29 | */ |
||
| 30 | private $comments = []; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Client cache |
||
| 34 | * @var CommentClient |
||
| 35 | */ |
||
| 36 | private $client; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Comment constructor. |
||
| 40 | * |
||
| 41 | * @param string $base |
||
| 42 | * @param string $userAgent |
||
| 43 | */ |
||
| 44 | public function __construct($base, $userAgent) |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Add |
||
| 52 | * |
||
| 53 | * @param string $line |
||
| 54 | * @return bool |
||
| 55 | */ |
||
| 56 | public function add($line) |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Client |
||
| 64 | * |
||
| 65 | * @return CommentClient |
||
| 66 | */ |
||
| 67 | public function client() |
||
| 74 | |||
| 75 | /** |
||
| 76 | * Render |
||
| 77 | * |
||
| 78 | * @return string[] |
||
| 79 | */ |
||
| 80 | public function render() |
||
| 88 | } |
||
| 89 |