Completed
Push — master ( 7e4f78...5ca817 )
by Filippo
02:47
created

SMSFactorManager   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

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 SMSFactor.
5
 *
6
 * (c) Filippo Galante <[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 IlGala\SMSFactor;
13
14
use GrahamCampbell\Manager\AbstractManager;
15
use Illuminate\Contracts\Config\Repository;
16
17
/**
18
 * This is the SMSFactor manager class.
19
 *
20
 * @method mixed createAccount()
21
 * @method mixed credits()
22
 * @method mixed send()
23
 * @method mixed sendLists()
24
 * @method mixed delete()
25
 * @method mixed contactList()
26
 * @method mixed getContactList()
27
 * @method mixed deduplicate()
28
 * @method mixed deleteContact()
29
 * @method mixed getBlacklist()
30
 *
31
 * @author Filippo Galante <[email protected]>
32
 */
33
class SMSFactorManager extends AbstractManager
34
{
35
36
    /**
37
     * The factory instance.
38
     *
39
     * @var \IlGala\SMSFactor\SMSFactorFactory
40
     */
41
    protected $factory;
42
43
    /**
44
     * Create a new digitalocean manager instance.
45
     *
46
     * @param \Illuminate\Contracts\Config\Repository          $config
47
     * @param \IlGala\SMSFactor\SMSFactorFactory        $factory
48
     *
49
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
50
     */
51
    public function __construct(Repository $config, SMSFactorFactory $factory)
52
    {
53
        parent::__construct($config);
54
        $this->factory = $factory;
55
    }
56
57
    /**
58
     * Create the connection instance.
59
     *
60
     * @param array $config
61
     *
62
     * @return \IlGala\SMSFactor\SMSFactor
63
     */
64
    protected function createConnection(array $config)
65
    {
66
        return $this->factory->make($config);
67
    }
68
69
    /**
70
     * Get the configuration name.
71
     *
72
     * @return string
73
     */
74
    protected function getConfigName()
75
    {
76
        return 'smsfactor';
77
    }
78
79
    /**
80
     * Get the factory instance.
81
     *
82
     * @return \IlGala\SMSFactor\SMSFactorFactory
83
     */
84
    public function getFactory()
85
    {
86
        return $this->factory;
87
    }
88
89
}
90