GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

ReceitaFederal.php ➔ receitaFederal()   B
last analyzed

Complexity

Conditions 4
Paths 2

Size

Total Lines 25
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 9
nc 2
nop 3
dl 0
loc 25
rs 8.5806
c 0
b 0
f 0
1
<?php
2
3
if (!function_exists('receitafederal')) {
4
	/**
5
	 * Helper retorna informações da Receita Federal
6
	 * @SuppressWarnings(PHPMD)
7
	 * @param  integer $document CNPJ
8
	 * @param  string $cookie   cookie request
9
	 * @param  string $captcha  Captcha resolvido
10
	 * @return array
11
	 */
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();
0 ignored issues
show
Bug introduced by
The method scraping cannot be called on $crawler (of type array).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
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
}