|
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 smsfactor manager instance. |
|
45
|
|
|
* |
|
46
|
|
|
* @param \Illuminate\Contracts\Config\Repository $config |
|
47
|
|
|
* @param \IlGala\SMSFactor\SMSFactorFactory $factory |
|
48
|
|
|
* |
|
49
|
|
|
* @return void |
|
|
|
|
|
|
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
|
|
|
|
Adding a
@returnannotation 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.