Total Complexity | 5 |
Total Lines | 66 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class SmsService |
||
6 | { |
||
7 | |||
8 | protected $driver ; |
||
9 | |||
10 | protected $mode ; |
||
11 | |||
12 | protected $class ; |
||
13 | |||
14 | |||
15 | /** |
||
16 | * SmsService constructor. |
||
17 | */ |
||
18 | public function __construct() |
||
19 | { |
||
20 | $this->driver = config('sms.default'); |
||
21 | |||
22 | $this->class = config('sms.map.'.$this->driver); |
||
23 | |||
24 | } |
||
25 | |||
26 | /** |
||
27 | * @param $key |
||
28 | * @return $this |
||
29 | */ |
||
30 | public function driver($key) |
||
31 | { |
||
32 | $this->driver = $key ; |
||
33 | |||
34 | $this->class = config('sms.map.'.$this->driver); |
||
35 | |||
36 | return $this; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * @param $text |
||
41 | * @return mixed |
||
42 | */ |
||
43 | public function text($text) |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * @param null $code |
||
|
|||
52 | * @return mixed |
||
53 | */ |
||
54 | public function pattern($code = null) |
||
55 | { |
||
56 | $drive = $this->drive('pattern',[$code]); |
||
57 | |||
58 | return $drive; |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * @param $key |
||
63 | * @param array $params |
||
64 | * @return mixed |
||
65 | */ |
||
66 | public function drive($key,$params = []) |
||
71 | } |
||
72 | |||
73 | } |
||
74 |