Conditions | 5 |
Paths | 2 |
Total Lines | 27 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | function sintegra($portal = 'SP', $document = false, $cookie = false, $captcha = false, $params = []) |
||
14 | { |
||
15 | /** |
||
16 | * Inicia a classe |
||
17 | * @var object \zServices\Sintegra\Services\Portais\{$portal}\Service |
||
18 | */ |
||
19 | $search = (new \zServices\Sintegra\Search)->service($portal); |
||
20 | |||
21 | /** |
||
22 | * @var array data |
||
23 | */ |
||
24 | if ($document == true && $cookie == true && $captcha == true && count($params) > 0) { |
||
25 | $crawler = $search->data($document, $cookie, $captcha, $params); |
||
26 | |||
27 | return $crawler->scraping(); |
||
|
|||
28 | } |
||
29 | |||
30 | // Se não retorna requisição inicial |
||
31 | // com cookie e captcha |
||
32 | $search->request(); |
||
33 | |||
34 | return [ |
||
35 | 'cookie' => $search->cookie(), |
||
36 | 'image' => $search->captcha(), |
||
37 | 'paramBot' => $search->params()['parambot'] |
||
38 | ]; |
||
39 | } |
||
40 | } |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.