Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit105c6f4

Browse files
committed
[Notifier] [Free Mobile] Could not use custom host in DSN
1 parent3a3b249 commit105c6f4

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

‎src/Symfony/Component/Notifier/Bridge/FreeMobile/FreeMobileTransport.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727
finalclass FreeMobileTransportextends AbstractTransport
2828
{
29-
protectedconstHOST ='https://smsapi.free-mobile.fr/sendmsg';
29+
protectedconstHOST ='smsapi.free-mobile.fr/sendmsg';
3030

3131
private$login;
3232
private$password;

‎src/Symfony/Component/Notifier/Bridge/FreeMobile/FreeMobileTransportFactory.php‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ public function create(Dsn $dsn): TransportInterface
4343
thrownewIncompleteDsnException('Missing phone.',$dsn->getOriginalDsn());
4444
}
4545

46-
returnnewFreeMobileTransport($login,$password,$phone,$this->client,$this->dispatcher);
46+
$host ='default' ===$dsn->getHost() ?null :$dsn->getHost();
47+
$port =$dsn->getPort();
48+
49+
return (newFreeMobileTransport($login,$password,$phone,$this->client,$this->dispatcher))->setHost($host)->setPort($port);
4750
}
4851

4952
protectedfunctiongetSupportedSchemes():array

‎src/Symfony/Component/Notifier/Bridge/FreeMobile/Tests/FreeMobileTransportFactoryTest.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ public function testCreateWithDsn()
2323
{
2424
$factory =$this->createFactory();
2525

26-
$dsn ='freemobile://login:pass@default?phone=0611223344';
27-
$transport =$factory->create(Dsn::fromString($dsn));
28-
$transport->setHost('host.test');
26+
$transport =$factory->create(Dsn::fromString('freemobile://login:pass@host.test?phone=0611223344'));
2927

3028
$this->assertSame('freemobile://host.test?phone=0611223344', (string)$transport);
3129
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp