Conditions | 5 |
Paths | 2 |
Total Lines | 25 |
Code Lines | 10 |
Lines | 5 |
Ratio | 20 % |
1 | <?php |
||
12 | function sintegra($portal = 'SP', $document = null, $cookie = null, $captcha = null, $params = null ) |
||
13 | { |
||
14 | /** |
||
15 | * Inicia a classe |
||
16 | * @var object \zServices\Sintegra\Services\Portais\{$portal}\Service |
||
17 | */ |
||
18 | $search = (new \zServices\Sintegra\Search)->service($portal); |
||
19 | |||
20 | // Esta pesquisando por um documento? |
||
21 | View Code Duplication | if($document && $cookie && captcha && $params) { |
|
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 | 'paramBot' => $search->params()['parambot'] |
||
35 | ]; |
||
36 | } |
||
37 | } |
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: