Passed
Push — main ( 665b0f...c91c7d )
by Leandro
01:42
created

Environment::getApiBoletoConsultaUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
namespace Itau\API;
3
4
/**
5
 * Class Environment
6
 *
7
 * @package Itau\API
8
 */
9
class Environment
10
{
11
12
    private $apiPix;
13
    private $apiBolecode;
14
    private $apiAuth;
15
    private $apiBoleto;
16
    private $apiBoletoConsulta;
17
18
    /**
19
     *
20
     * @param string $api
21
     *
22
     */
23
    private function __construct($apiAuth, $apiPix, $apiBolecode, $apiBoleto, $apiBoletoConsulta)
24
    {
25
        $this->apiAuth = $apiAuth;
26
        $this->apiPix = $apiPix;
27
        $this->apiBolecode = $apiBolecode;
28
        $this->apiBoleto = $apiBoleto;
29
        $this->apiBoletoConsulta = $apiBoletoConsulta;
30
    }
31
32
    /**
33
     *
34
     * @return Environment
35
     */
36
    public static function production()
37
    {
38
        return new Environment(
39
            'https://sts.itau.com.br/api/oauth/token',
40
            'https://secure.api.itau/pix_recebimentos/v2',
41
            'https://secure.api.itau/pix_recebimentos_conciliacoes/v2',
42
            'https://api.itau.com.br/cash_management/v2',
43
            'https://api.itau.com.br/cash_management/v2',
44
            'https://secure.api.cloud.itau.com.br/boletoscash/v2'
0 ignored issues
show
Unused Code introduced by
The call to Itau\API\Environment::__construct() has too many arguments starting with 'https://secure.api.clou....com.br/boletoscash/v2'. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

44
        return /** @scrutinizer ignore-call */ new Environment(

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
45
        );
46
    }
47
48
    public function getApiPixUrl(): string
49
    {
50
        return $this->apiPix;
51
    }
52
53
    public function getApiBoleCodeUrl(): string
54
    {
55
        return $this->apiBolecode;
56
    }
57
58
    public function getApiBoletoUrl(): string
59
    {
60
        return $this->apiBoleto;
61
    }
62
63
    public function getApiBoletoConsultaUrl(): string
64
    {
65
        return $this->apiBoletoConsulta;
66
    }
67
68
    public function getApiUrlAuth(): string
69
    {
70
        return $this->apiAuth;
71
    }
72
}