TransIPManager   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 53
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A createConnection() 0 4 1
A getConfigName() 0 4 1
A getFactory() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of Laravel TransIP.
5
 *
6
 * (c) Hidde Beydals <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace TransIP\Laravel;
13
14
use GrahamCampbell\Manager\AbstractManager;
15
use Illuminate\Contracts\Config\Repository;
16
17
/**
18
 * @method \TransIP\Api\Colocation colocation()
19
 * @method \TransIP\Api\Colocation colocation_service()
20
 * @method \TransIP\Api\Colocation colocationService()
21
 * @method \TransIP\Api\Domain     domain()
22
 * @method \TransIP\Api\Domain     domain_service()
23
 * @method \TransIP\Api\Domain     domainService()
24
 * @method \TransIP\Api\Forward    forward()
25
 * @method \TransIP\Api\Forward    forward_service()
26
 * @method \TransIP\Api\Forward    forwardService()
27
 * @method \TransIP\Api\Vps        vps()
28
 * @method \TransIP\Api\Vps        vps_service()
29
 * @method \TransIP\Api\Vps        vpsService()
30
 * @method \TransIP\Api\WebHosting hosting()
31
 * @method \TransIP\Api\WebHosting web_hosting()
32
 * @method \TransIP\Api\WebHosting webHosting()
33
 * @method \TransIP\Api\WebHosting web_hosting_service()
34
 * @method \TransIP\Api\WebHosting webHostingService()
35
 * @method \TransIP\Api\Haip       haip()
36
 * @method \TransIP\Api\Haip       ha_ip()
37
 * @method \TransIP\Api\Haip       ha_ip_service()
38
 * @method \TransIP\Api\Haip       haip_service()
39
 * @method \TransIP\Api\Haip       haipService()
40
 *
41
 * @author Hidde Beydals <[email protected]>
42
 */
43
class TransIPManager extends AbstractManager
44
{
45
    /**
46
     * The factory instance.
47
     *
48
     * @var \TransIP\Laravel\TransIPFactory
49
     */
50
    protected $factory;
51
52
    /**
53
     * Create a new TransIP manager instance.
54
     *
55
     * @param \Illuminate\Contracts\Config\Repository $config
56
     * @param \TransIP\Laravel\TransIPFactory  $factory
57
     */
58
    public function __construct(Repository $config, TransIPFactory $factory)
59
    {
60
        parent::__construct($config);
61
        $this->factory = $factory;
62
    }
63
64
    /**
65
     * Create the connection instance.
66
     *
67
     * @param array $config
68
     *
69
     * @return \TransIP\Client
70
     */
71
    protected function createConnection(array $config)
72
    {
73
        return $this->factory->create($config);
74
    }
75
76
    /**
77
     * Get the configuration name.
78
     *
79
     * @return string
80
     */
81
    protected function getConfigName()
82
    {
83
        return 'transip';
84
    }
85
86
    /**
87
     * Get the factory instance.
88
     *
89
     * @return \TransIP\Laravel\TransIPFactory
90
     */
91
    public function getFactory()
92
    {
93
        return $this->factory;
94
    }
95
}
96