Completed
Push — master ( a1a6a3...9324c5 )
by Jean C.
04:28
created

src/Moip.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Artesaos\Moip;
4
5
use Moip\Moip as Api;
6
use Moip\MoipBasicAuth;
7
8
/**
9
 * Class Moip.
10
 *
11
 * @package Artesaos\Moip
12
 */
13
class Moip
14
{
15
    /**
16
     * Class Moip sdk.
17
     *
18
     * @var \Moip\Moip
19
     **/
20
    private $moip;
21
22
    /**
23
     * Moip constructor.
24
     */
25
    function __construct()
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
26
    {
27
        $this->moip = new Api(new MoipBasicAuth(config('moip.credentials.token'), config('moip.credentials.key')), $this->getHomologated());
28
    }
29
30
    /**
31
     * Start Moip sdk.
32
     *
33
     * @deprecated
34
     */
35
    public function start()
36
    {
37
        return $this;
38
    }
39
40
    /**
41
     * Create a new Customer instance.
42
     *
43
     * @return \Moip\Resource\Customer
44
     */
45
    public function customers()
46
    {
47
        return $this->moip->customers();
48
    }
49
50
    /**
51
     * Create a new Entry instance.
52
     *
53
     * @return \Moip\Resource\Entry
54
     */
55
    public function entries()
56
    {
57
        return $this->moip->entries();
58
    }
59
60
    /**
61
     * Create a new Order instance.
62
     *
63
     * @return \Moip\Resource\Orders
64
     */
65
    public function orders()
66
    {
67
        return $this->moip->orders();
68
    }
69
70
    /**
71
     * Create a new Payment instance.
72
     *
73
     * @return \Moip\Resource\Payment
74
     */
75
    public function payments()
76
    {
77
        return $this->moip->payments();
78
    }
79
80
    /**
81
     * Create a new Multiorders instance.
82
     *
83
     * @return \Moip\Resource\Multiorders
84
     */
85
    public function multiorders()
86
    {
87
        return $this->moip->multiorders();
88
    }
89
90
    /**
91
     * Get endpoint of request.
92
     *
93
     * @return string
94
     */
95
    private function getHomologated()
96
    {
97
        return config('moip.homologated') === true ? Api::ENDPOINT_PRODUCTION : Api::ENDPOINT_SANDBOX;
98
    }
99
}
100