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.

Sintegra.php ➔ sintegra()   B
last analyzed

Complexity

Conditions 5
Paths 2

Size

Total Lines 27
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 10
nc 2
nop 5
dl 0
loc 27
rs 8.439
c 0
b 0
f 0
1
<?php
2
if (!function_exists('sintegra'))
3
{
4
	/**
5
	 * Helper retorna informações do sintegra
6
	 * @SuppressWarnings(PHPMD)
7
	 * @param  integer $document CNPJ or IE
8
	 * @param  string $cookie   cookie request
9
	 * @param  string $captcha  Captcha resolvido
10
	 * @param  array $params
11
	 * @return array
12
	 */
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();
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...
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
}