1 | <?php |
||
12 | class UserAgent implements DirectiveInterface, RobotsTxtInterface |
||
13 | { |
||
14 | use ObjectTools; |
||
15 | |||
16 | const SUB_DIRECTIVES = [ |
||
17 | self::DIRECTIVE_ALLOW, |
||
18 | self::DIRECTIVE_CACHE_DELAY, |
||
19 | self::DIRECTIVE_CRAWL_DELAY, |
||
20 | self::DIRECTIVE_DISALLOW, |
||
21 | ]; |
||
22 | |||
23 | /** |
||
24 | * Directive |
||
25 | */ |
||
26 | const DIRECTIVE = 'User-agent'; |
||
27 | |||
28 | protected $parent; |
||
29 | protected $array = []; |
||
30 | |||
31 | protected $allow; |
||
32 | protected $cacheDelay; |
||
33 | protected $crawlDelay; |
||
34 | protected $disallow; |
||
35 | |||
36 | public function __construct($array, $parent = null) |
||
44 | |||
45 | /** |
||
46 | * Add |
||
47 | * |
||
48 | * @param string $line |
||
49 | * @return bool |
||
50 | */ |
||
51 | public function add($line) |
||
66 | |||
67 | /** |
||
68 | * Check rules |
||
69 | * |
||
70 | * @param string $url - URL to check |
||
71 | * @param string $type - directive to check |
||
72 | * @return bool |
||
73 | */ |
||
74 | public function check($url, $type) |
||
84 | |||
85 | public function export() |
||
94 | } |
||
95 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..