Environment::homolog()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Getnet\API;
4
5
/**
6
 * Class Environment
7
 *
8
 * @package Getnet\API
9
 */
10
class Environment
0 ignored issues
show
Coding Style introduced by
Since you have declared the constructor as private, maybe you should also declare the class as final.
Loading history...
11
{
12
13
    /** @var */
14
    private $api;
15
16
    /**
17
     * Environment constructor.
18
     * @param string $api
19
     */
20
    private function __construct($api)
21
    {
22
        $this->api = $api;
23
    }
24
25
    /**
26
     * @return Environment
27
     */
28
    public static function sandbox()
29
    {
30
        return new Environment('https://api-sandbox.getnet.com.br');
31
    }
32
33
    /**
34
     * @return Environment
35
     */
36
    public static function homolog()
37
    {
38
        return new Environment('https://api-homologacao.getnet.com.br');
39
    }
40
41
    /**
42
     * @return Environment
43
     */
44
    public static function production()
45
    {
46
        return new Environment('https://api.getnet.com.br');
47
    }
48
49
    /**
50
     * @return mixed
51
     */
52
    public function getApiUrl()
53
    {
54
        return $this->api;
55
    }
56
}
57