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