1 | <?php |
||
9 | class GoSmsApi |
||
10 | { |
||
11 | const FORMAT_JSON = 3; |
||
12 | |||
13 | /** @var string */ |
||
14 | protected $apiUrl = 'http://api.gosms.com.my/eapi/sms.aspx'; |
||
15 | |||
16 | /** @var HttpClient */ |
||
17 | protected $httpClient; |
||
18 | |||
19 | /** @var string */ |
||
20 | protected $company; |
||
21 | |||
22 | /** @var string */ |
||
23 | protected $username; |
||
24 | |||
25 | /** @var string */ |
||
26 | protected $password; |
||
27 | |||
28 | /** @var string */ |
||
29 | protected $sender; |
||
30 | |||
31 | /** @var string */ |
||
32 | protected $gateway; |
||
33 | |||
34 | /** @var string */ |
||
35 | protected $type; |
||
36 | |||
37 | /** @var string */ |
||
38 | protected $charge; |
||
39 | |||
40 | /** @var string */ |
||
41 | protected $maskid; |
||
42 | |||
43 | /** @var string */ |
||
44 | protected $convert; |
||
45 | |||
46 | public function __construct($config) |
||
64 | |||
65 | /** |
||
66 | * @param array $params |
||
67 | * |
||
68 | * @return array |
||
69 | * |
||
70 | * @throws CouldNotSendNotification |
||
71 | */ |
||
72 | public function send($params) |
||
96 | } |
||
97 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: