8000 fixup! [Notifier][SpotHit] Support SMSLong and SMSLongNBr API parameters · symfony/symfony@a5c5707 · GitHub
[go: up one dir, main page]

Skip to content

Commit a5c5707

Browse files
fixup! [Notifier][SpotHit] Support SMSLong and SMSLongNBr API parameters
1 parent 7e6eee6 commit a5c5707

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

src/Symfony/Component/Notifier/Bridge/SpotHit/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CHANGELOG
44
6.3
55
---
66

7-
* Support SMSLong and SMSLongNBr API parameters
7+
* Support `SMSLong` and `SMSLongNBr` API parameters
88

99
6.2
1010
---

src/Symfony/Component/Notifier/Bridge/SpotHit/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ where:
1313
- `TOKEN` is your Spot-Hit API key
1414
- `FROM` is the custom sender (3-11 letters, default is a 5 digits phone number)
1515
- `SMSLONG` (optional) 0 or 1 : allows SMS messages longer than 160 characters
16-
- `SMSLONGNBR` (optional) Allows to check the size of the long SMS sent. You must send the number of concatenated SMS as a value. If our counter indicates a different number, your message will be rejected.
16+
- `SMSLONGNBR` (optional) integer : allows to check the size of the long SMS sent. You must send the number of concatenated SMS as a value. If our counter indicates a different number, your message will be rejected.
1717

1818
Resources
1919
---------

src/Symfony/Component/Notifier/Bridge/SpotHit/SpotHitTransport.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,14 @@ public function __toString(): string
6060
public function setSmsLong(?bool $smsLong): self
6161
{
6262
$this->smsLong = $smsLong;
63+
6364
return $this;
6465
}
6566

6667
public function setLongNBr(?int $smsLongNBr): self
6768
{
6869
$this->smsLongNBr = $smsLongNBr;
70+
6971
return $this;
7072
}
7173

src/Symfony/Component/Notifier/Bridge/SpotHit/SpotHitTransportFactory.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,7 @@ public function create(Dsn $dsn): SpotHitTransport
3535
$host = 'default' === $dsn->getHost() ? null : $dsn->getHost();
3636
$port = $dsn->getPort();
3737

38-
return (new SpotHitTransport($token, $from, $this->client, $this->dispatcher))
39-
->setHost($host)
40-
->setPort($port)
41-
->setSmsLong($smsLong)
42-
->setLongNBr($smsLongNBr)
43-
;
38+
return (new SpotHitTransport($token, $from, $this->client, $this->dispatcher))->setHost($host)->setPort($port)->setSmsLong($smsLong)->setLongNBr($smsLongNBr);
4439
}
4540

4641
protected function getSupportedSchemes(): array

src/Symfony/Component/Notifier/Bridge/SpotHit/Tests/SpotHitTransportTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@ function(array $bodyArguments) { $this->assertSame('1', $bodyArguments['smslong'
7979
function(SpotHitTransport $transport) { $transport->setLongNBr(3); },
8080
function(array $bodyArguments) { $this->assertSame('3', $bodyArguments['smslongnbr']); },
8181
];
82+
83+
yield [
84+
function(SpotHitTransport $transport) {
85+
$transport->setSmsLong(true);
86+
$transport->setLongNBr(3);
87+
},
88+
function(array $bodyArguments) {
89+
$this->assertSame( 6203 '1', $bodyArguments['smslong']);
90+
$this->assertSame('3', $bodyArguments['smslongnbr']);
91+
},
92+
];
8293
}
8394

8495
/**

0 commit comments

Comments
 (0)
0