| 1 | <?php |
||
| 5 | class Crawler |
||
| 6 | { |
||
| 7 | protected $timeout = 60; |
||
| 8 | protected $url; |
||
| 9 | protected $xpath; |
||
| 10 | protected $html; |
||
| 11 | protected $content; |
||
| 12 | |||
| 13 | 2 | public function __construct($url, $xpath = '//') |
|
| 18 | |||
| 19 | /** |
||
| 20 | * Obtener el HTML y parsear su contenido. |
||
| 21 | * |
||
| 22 | * @return void |
||
| 23 | */ |
||
| 24 | 1 | public function start() |
|
| 30 | |||
| 31 | /** |
||
| 32 | * Obtener el contenido HTML de una página. |
||
| 33 | * |
||
| 34 | * |
||
| 35 | * @param string $url Url de la página a scrapear |
||
| 36 | * |
||
| 37 | * @return string |
||
| 38 | */ |
||
| 39 | 2 | public function html() |
|
| 45 | |||
| 46 | /** |
||
| 47 | * Obtener el contenido. |
||
| 48 | * |
||
| 49 | * @return string |
||
| 50 | */ |
||
| 51 | 1 | public function getContent() |
|
| 55 | |||
| 56 | /** |
||
| 57 | * Almacenar el codigo HTML. |
||
| 58 | * |
||
| 59 | * @param string $html |
||
| 60 | * @param string $xpath |
||
| 61 | */ |
||
| 62 | 1 | public function setContent($html, $xpath) |
|
| 67 | |||
| 68 | /** |
||
| 69 | * Obtner la URL. |
||
| 70 | */ |
||
| 71 | public function getUrl() |
||
| 75 | |||
| 76 | /** |
||
| 77 | * Guardar el tiempo de espera de una página. |
||
| 78 | */ |
||
| 79 | public function setTimeout(int $timeout) |
||
| 83 | } |
||
| 84 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignorePhpDoc annotation to the duplicate definition and it will be ignored.