| 1 | <?php |
||
| 5 | class Crawler |
||
| 6 | { |
||
| 7 | protected $timeout = 60; |
||
| 8 | protected $url = ''; |
||
| 9 | protected $xpath = ''; |
||
| 10 | protected $html = ''; |
||
| 11 | protected $content = ''; |
||
| 12 | |||
| 13 | 1 | public function start(string $url, string $xpath) |
|
| 21 | |||
| 22 | /** |
||
| 23 | * Obtener el contenido HTML de una página. |
||
| 24 | * |
||
| 25 | * |
||
| 26 | * @param string $url Url de la página a scrapear |
||
| 27 | * |
||
| 28 | * @return string |
||
| 29 | */ |
||
| 30 | 2 | public function getHtml(string $url) |
|
| 36 | |||
| 37 | /** |
||
| 38 | * Almacenar el codigo HTML. |
||
| 39 | * |
||
| 40 | * @param string $html |
||
| 41 | * @param string $xpath |
||
| 42 | */ |
||
| 43 | 1 | public function setContent($html, $xpath) |
|
| 48 | |||
| 49 | /** |
||
| 50 | * Obtner el contenido. |
||
| 51 | */ |
||
| 52 | public function getContent() |
||
| 53 | { |
||
| 54 | return $this->content; |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Obtner la URL. |
||
| 59 | */ |
||
| 60 | public function getUrl() |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Guardar el tiempo de espera de una página. |
||
| 67 | */ |
||
| 68 | public function setTimeout(int $timeout) |
||
| 72 | } |
||
| 73 |
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..