|
3 | 3 | namespace CM\Messaging; |
4 | 4 |
|
5 | 5 | use CM\Messaging\Exception\InvalidAllowedChannelException; |
6 | | -use CM\Messaging\Exception\InvalidStrategyException; |
7 | 6 | use CM\Messaging\Exception\InvalidConfigurationException; |
| 7 | +use CM\Messaging\Exception\InvalidStrategyException; |
8 | 8 | use CM\Messaging\Http\ApiHttpClient; |
9 | 9 | use CM\Messaging\Request\Messages; |
10 | 10 | use CM\Messaging\Request\Messages\Msg; |
|
26 | 26 | class Client |
27 | 27 | { |
28 | 28 |
|
29 | | - /** |
30 | | - * It possible to let our gateway do the encoding detection for you. In case it detects characters that are not part of the GSM character set, the message will be delivered as Unicode. |
31 | | - * Any existing DCS value will be ignored. If the message contains more than 70 characters in Unicode format it will be split into a multipart message. |
32 | | - * |
33 | | - * @var BodyType |
34 | | - */ |
35 | | - private $bodyType; |
36 | | - |
37 | | - /** |
38 | | - * You use the DCS (data coding scheme) parameter to indicate the type of message you are sending. If you set DCS to '0' or do not include the parameter, the messages uses standard GSM encoding. |
39 | | - * If DCS is set to '8' the message will be encoded using Unicode UCS2. |
40 | | - * |
41 | | - * @var int |
42 | | - */ |
43 | | - private $dcs; |
44 | | - |
45 | | - /** |
46 | | - * Here you can include your message reference. This information will be returned in a status report so you can match the message and it's status. It should be included in the XML when posting. |
47 | | - * Restrictions: 1 - 32 alphanumeric characters and reference will not work for demo accounts. |
48 | | - * |
49 | | - * @var string |
50 | | - */ |
51 | | - private $reference; |
52 | | - |
53 | 29 | /** |
54 | 30 | * Applying custom grouping names to messages helps filter your messages. With up to three levels of custom grouping fields that can be set, subsets of messages can be further broken down. |
55 | 31 | * The custom grouping name can be up to 100 characters of your choosing. It’s recommended to limit the number of unique custom groupings to 1000. |
56 | 32 | * |
57 | 33 | * @var string |
58 | 34 | */ |
59 | 35 | protected $customGrouping1; |
60 | | - |
61 | 36 | /** |
62 | 37 | * Applying custom grouping names to messages helps filter your messages. With up to three levels of custom grouping fields that can be set, subsets of messages can be further broken down. |
63 | 38 | * The custom grouping name can be up to 100 characters of your choosing. It’s recommended to limit the number of unique custom groupings to 1000. |
64 | 39 | * |
65 | 40 | * @var string |
66 | 41 | */ |
67 | 42 | protected $customGrouping2; |
68 | | - |
69 | 43 | /** |
70 | 44 | * Applying custom grouping names to messages helps filter your messages. With up to three levels of custom grouping fields that can be set, subsets of messages can be further broken down. |
71 | 45 | * The custom grouping name can be up to 100 characters of your choosing. It’s recommended to limit the number of unique custom groupings to 1000. |
72 | 46 | * |
73 | 47 | * @var string |
74 | 48 | */ |
75 | 49 | protected $customGrouping3; |
76 | | - |
| 50 | + /** |
| 51 | + * It possible to let our gateway do the encoding detection for you. In case it detects characters that are not part of the GSM character set, the message will be delivered as Unicode. |
| 52 | + * Any existing DCS value will be ignored. If the message contains more than 70 characters in Unicode format it will be split into a multipart message. |
| 53 | + * |
| 54 | + * @var BodyType |
| 55 | + */ |
| 56 | + private $bodyType; |
| 57 | + /** |
| 58 | + * You use the DCS (data coding scheme) parameter to indicate the type of message you are sending. If you set DCS to '0' or do not include the parameter, the messages uses standard GSM encoding. |
| 59 | + * If DCS is set to '8' the message will be encoded using Unicode UCS2. |
| 60 | + * |
| 61 | + * @var int |
| 62 | + */ |
| 63 | + private $dcs; |
| 64 | + /** |
| 65 | + * Here you can include your message reference. This information will be returned in a status report so you can match the message and it's status. It should be included in the XML when posting. |
| 66 | + * Restrictions: 1 - 32 alphanumeric characters and reference will not work for demo accounts. |
| 67 | + * |
| 68 | + * @var string |
| 69 | + */ |
| 70 | + private $reference; |
77 | 71 | /** |
78 | 72 | * Used when sending multipart or concatenated SMS messages and always used together. Indicate the minimum and maximum of message parts that you allow the gateway to send for this message. |
79 | 73 | * Technically the gateway will first check if a message is larger than 160 characters, if so, the message will be cut into multiple 153 characters parts limited by these parameters. |
@@ -103,7 +97,7 @@ class Client |
103 | 97 | * |
104 | 98 | * @var array[AllowedChannel] |
105 | 99 | */ |
106 | | - private $allowedChannels = [AllowedChannel::SMS]; |
| 100 | + private $allowedChannels; |
107 | 101 |
|
108 | 102 | /** |
109 | 103 | * Product token to authorize with. |
@@ -145,6 +139,7 @@ public function __construct(HttpClient $httpClient, $productToken) |
145 | 139 | * @param array $parameters |
146 | 140 | * |
147 | 141 | * @return Response\Response |
| 142 | + * @throws \Http\Client\Exception\HttpException |
148 | 143 | * @throws \CM\Messaging\Exception\BadRequestException |
149 | 144 | * @throws \RuntimeException |
150 | 145 | * @throws \Http\Client\Exception |
@@ -217,7 +212,7 @@ public function getBodyType() |
217 | 212 | } |
218 | 213 |
|
219 | 214 | /** |
220 | | - * @param BodyType $bodyType |
| 215 | + * @param null|string|BodyType $bodyType |
221 | 216 | * |
222 | 217 | * @return $this |
223 | 218 | */ |
@@ -403,7 +398,7 @@ public function getAllowedChannels() |
403 | 398 | } |
404 | 399 |
|
405 | 400 | /** |
406 | | - * @param array|AllowedChannel $allowedChannels |
| 401 | + * @param array|string|AllowedChannel $allowedChannels |
407 | 402 | * |
408 | 403 | * @return $this |
409 | 404 | */ |
|
0 commit comments