Conditions | 4 |
Paths | 2 |
Total Lines | 24 |
Code Lines | 9 |
Lines | 5 |
Ratio | 20.83 % |
1 | <?php |
||
12 | function receitaFederal($document = null, $cookie = null, $captcha = null, $params = []) |
||
13 | { |
||
14 | /** |
||
15 | * Inicia a classe |
||
16 | * @var object \zServices\ReceitaFederal\Services\Portais\{$portal}\Service |
||
17 | */ |
||
18 | $search = (new \zServices\ReceitaFederal\Search)->service(); |
||
19 | |||
20 | // Esta pesquisando por um documento? |
||
21 | View Code Duplication | if($document && $cookie && captcha) { |
|
22 | $crawler = $search->data($document, $cookie, $captcha, $params); |
||
23 | |||
24 | return $crawler->scraping(); |
||
25 | } |
||
26 | |||
27 | // Se não retorna requisição inicial |
||
28 | // com cookie e captcha |
||
29 | $search->request(); |
||
30 | |||
31 | return [ |
||
32 | 'cookie' => $search->cookie(), |
||
33 | 'image' => $search->captcha() |
||
34 | ]; |
||
35 | } |
||
36 | } |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
integer
values, zero is a special case, in particular the following results might be unexpected: