Skip to content

Commit f297a33

Browse files
Merge pull request #6 from CMTelecom/develop
Develop
2 parents bdbce21 + 657e355 commit f297a33

File tree

12 files changed

+181
-218
lines changed

12 files changed

+181
-218
lines changed

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [Unreleased]
8+
### Removed
9+
- removed default channel selection
10+
- removed obsolete test assertions
11+
- removed config file
12+
13+
### Fixed
14+
- fixed body type php doc accept string parameters
15+
16+
### Updated
17+
- updated line formatting
18+
- updated imports
19+
820
## [1.1.1] - 2017-10-30
921
### Changed
1022
- change custom grouping fields to private for constancy
@@ -45,7 +57,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
4557
- initial code
4658

4759
[Unreleased]: https://github.com/CMTelecom/messaging-php/compare/1.1.1....HEAD
48-
[1.1.0]: https://github.com/CMTelecom/messaging-php/compare/1.1.0...1.1.1
60+
[1.1.1]: https://github.com/CMTelecom/messaging-php/compare/1.1.0...1.1.1
4961
[1.1.0]: https://github.com/CMTelecom/messaging-php/compare/1.0.2...1.1.0
5062
[1.0.2]: https://github.com/CMTelecom/messaging-php/compare/1.0.1...1.0.2
5163
[1.0.1]: https://github.com/CMTelecom/messaging-php/compare/1.0.0...1.0.1

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,23 +128,15 @@ try {
128128

129129
// returns true if all messages are accepted
130130
$result->isAccepted()
131-
// returns true if messages with these phone numbers are accepted
132-
$result->isAccepted(['0031612345678', '0031623456789'])
133131

134132
// returns true if all messages are failed
135133
$result->isFailed()
136-
// returns true if messages with these phone numbers are failed
137-
$result->isFailed(['0031612345678', '0031623456789'])
138134

139135
// returns an array with the accepted message responses
140136
$result->getAccepted()
141-
// returns an array with the accepted message responses containging these phone numbers
142-
$result->getAccepted(['0031612345678', '0031623456789'])
143137

144138
// returns an array with the failed message responses
145139
$result->getFailed()
146-
// returns an array with the failed message responses containging these phone numbers
147-
$result->getFailed(['0031612345678', '0031623456789'])
148140

149141
} catch (\CM\Messaging\Exception\BadRequestException $e) {
150142
// The request failed because of an invalid value, all messages has not been send

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/CM/Messaging/Client.php

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace CM\Messaging;
44

55
use CM\Messaging\Exception\InvalidAllowedChannelException;
6-
use CM\Messaging\Exception\InvalidStrategyException;
76
use CM\Messaging\Exception\InvalidConfigurationException;
7+
use CM\Messaging\Exception\InvalidStrategyException;
88
use CM\Messaging\Http\ApiHttpClient;
99
use CM\Messaging\Request\Messages;
1010
use CM\Messaging\Request\Messages\Msg;
@@ -26,54 +26,48 @@
2626
class Client
2727
{
2828

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-
5329
/**
5430
* 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.
5531
* 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.
5632
*
5733
* @var string
5834
*/
5935
protected $customGrouping1;
60-
6136
/**
6237
* 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.
6338
* 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.
6439
*
6540
* @var string
6641
*/
6742
protected $customGrouping2;
68-
6943
/**
7044
* 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.
7145
* 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.
7246
*
7347
* @var string
7448
*/
7549
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;
7771
/**
7872
* 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.
7973
* 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
10397
*
10498
* @var array[AllowedChannel]
10599
*/
106-
private $allowedChannels = [AllowedChannel::SMS];
100+
private $allowedChannels;
107101

108102
/**
109103
* Product token to authorize with.
@@ -145,6 +139,7 @@ public function __construct(HttpClient $httpClient, $productToken)
145139
* @param array $parameters
146140
*
147141
* @return Response\Response
142+
* @throws \Http\Client\Exception\HttpException
148143
* @throws \CM\Messaging\Exception\BadRequestException
149144
* @throws \RuntimeException
150145
* @throws \Http\Client\Exception
@@ -217,7 +212,7 @@ public function getBodyType()
217212
}
218213

219214
/**
220-
* @param BodyType $bodyType
215+
* @param null|string|BodyType $bodyType
221216
*
222217
* @return $this
223218
*/
@@ -403,7 +398,7 @@ public function getAllowedChannels()
403398
}
404399

405400
/**
406-
* @param array|AllowedChannel $allowedChannels
401+
* @param array|string|AllowedChannel $allowedChannels
407402
*
408403
* @return $this
409404
*/

src/CM/Messaging/Config.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/CM/Messaging/Http/ApiHttpClient.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace CM\Messaging\Http;
44

5-
use CM\Messaging\Config;
65
use CM\Messaging\Exception\BadRequestException;
76
use CM\Messaging\Response\Response;
87
use GuzzleHttp\Psr7\Request;
@@ -50,8 +49,6 @@ private function buildHeader()
5049
{
5150
return [
5251
'Content-Type' => 'application/json',
53-
'LANGUAGE' => Config::LANGUAGE,
54-
'SDK_VERSION' => Config::SDK_VERSION,
5552
'HTTP_CLIENT' => get_class($this->httpClient)
5653
];
5754
}

src/CM/Messaging/Message.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ public function getBody()
168168
}
169169

170170
/**
171-
* @param string $body
172-
* @param null|BodyType $type
171+
* @param string $body
172+
* @param null|string|BodyType $type
173173
*
174174
* @return $this
175175
*/
@@ -366,7 +366,7 @@ public function getAllowedChannels()
366366
}
367367

368368
/**
369-
* @param array|AllowedChannel $allowedChannels
369+
* @param array|string|AllowedChannel $allowedChannels
370370
*
371371
* @return $this
372372
*/

0 commit comments

Comments
 (0)