Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3f28f2a

Browse files
committed
[CS] [5.2] Replace easy occurrences of ?: with ??
1 parent b64ae4d commit 3f28f2a

File tree

24 files changed

+27
-27
lines changed

24 files changed

+27
-27
lines changed

src/Symfony/Component/BrowserKit/AbstractBrowser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ abstract class AbstractBrowser
5353
public function __construct(array $server = [], History $history = null, CookieJar $cookieJar = null)
5454
{
5555
$this->setServerParameters($server);
56-
$this->history = $history ?: new History();
57-
$this->cookieJar = $cookieJar ?: new CookieJar();
56+
$this->history = $history ?? new History();
57+
$this->cookieJar = $cookieJar ?? new CookieJar();
5858
}
5959

6060
/**

src/Symfony/Component/HttpClient/RetryableHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(HttpClientInterface $client, RetryStrategyInterface
4343
$this->client = $client;
4444
$this->strategy = $strategy ?? new GenericRetryStrategy();
4545
$this->maxRetries = $maxRetries;
46-
$this->logger = $logger ?: new NullLogger();
46+
$this->logger = $logger ?? new NullLogger();
4747
}
4848

4949
public function request(string $method, string $url, array $options = []): ResponseInterface

src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Transport/AmazonSqsTransportTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public function testTransportIsAMessageCountAware()
6060

6161
private function getTransport(SerializerInterface $serializer = null, Connection $connection = null)
6262
{
63-
$serializer = $serializer ?: $this->createMock(SerializerInterface::class);
64-
$connection = $connection ?: $this->createMock(Connection::class);
63+
$serializer = $serializer ?? $this->createMock(SerializerInterface::class);
64+
$connection = $connection ?? $this->createMock(Connection::class);
6565

6666
return new AmazonSqsTransport($connection, $serializer);
6767
}

src/Symfony/Component/Messenger/Bridge/Amqp/Transport/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function __construct(array $connectionOptions, array $exchangeOptions, ar
114114
], $connectionOptions);
115115
$this->exchangeOptions = $exchangeOptions;
116116
$this->queuesOptions = $queuesOptions;
117-
$this->amqpFactory = $amqpFactory ?: new AmqpFactory();
117+
$this->amqpFactory = $amqpFactory ?? new AmqpFactory();
118118
}
119119

120120
/**

src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineTransportTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public function testConfigureSchema()
7171

7272
private function getTransport(SerializerInterface $serializer = null, Connection $connection = null): DoctrineTransport
7373
{
74-
$serializer = $serializer ?: $this->createMock(SerializerInterface::class);
75-
$connection = $connection ?: $this->createMock(Connection::class);
74+
$serializer = $serializer ?? $this->createMock(SerializerInterface::class);
75+
$connection = $connection ?? $this->createMock(Connection::class);
7676

7777
return new DoctrineTransport($connection, $serializer);
7878
}

src/Symfony/Component/Notifier/Bridge/Discord/Tests/DiscordTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class DiscordTransportTest extends TransportTestCase
3030
*/
3131
public function createTransport(?HttpClientInterface $client = null): TransportInterface
3232
{
33-
return (new DiscordTransport('testToken', 'testWebhookId', $client ?: $this->createMock(HttpClientInterface::class)))->setHost('host.test');
33+
return (new DiscordTransport('testToken', 'testWebhookId', $client ?? $this->createMock(HttpClientInterface::class)))->setHost('host.test');
3434
}
3535

3636
public function toStringProvider(): iterable

src/Symfony/Component/Notifier/Bridge/Esendex/Tests/EsendexTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class EsendexTransportTest extends TransportTestCase
2929
*/
3030
public function createTransport(?HttpClientInterface $client = null): TransportInterface
3131
{
32-
return (new EsendexTransport('testToken', 'testAccountReference', 'testFrom', $client ?: $this->createMock(HttpClientInterface::class)))->setHost('host.test');
32+
return (new EsendexTransport('testToken', 'testAccountReference', 'testFrom', $client ?? $this->createMock(HttpClientInterface::class)))->setHost('host.test');
3333
}
3434

3535
public function toStringProvider(): iterable

src/Symfony/Component/Notifier/Bridge/Firebase/Tests/FirebaseTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class FirebaseTransportTest extends TransportTestCase
2929
*/
3030
public function createTransport(?HttpClientInterface $client = null): TransportInterface
3131
{
32-
return new FirebaseTransport('username:password', $client ?: $this->createMock(HttpClientInterface::class));
32+
return new FirebaseTransport('username:password', $client ?? $this->createMock(HttpClientInterface::class));
3333
}
3434

3535
public function toStringProvider(): iterable

src/Symfony/Component/Notifier/Bridge/FreeMobile/Tests/FreeMobileTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class FreeMobileTransportTest extends TransportTestCase
2626
*/
2727
public function createTransport(?HttpClientInterface $client = null): TransportInterface
2828
{
29-
return new FreeMobileTransport('login', 'pass', '0611223344', $client ?: $this->createMock(HttpClientInterface::class));
29+
return new FreeMobileTransport('login', 'pass', '0611223344', $client ?? $this->createMock(HttpClientInterface::class));
3030
}
3131

3232
public function toStringProvider(): iterable

src/Symfony/Component/Notifier/Bridge/GoogleChat/Tests/GoogleChatTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ final class GoogleChatTransportTest extends TestCase
3333
*/
3434
public function createTransport(?HttpClientInterface $client = null): TransportInterface
3535
{
36-
return new GoogleChatTransport('My-Space', 'theAccessKey', 'theAccessToken=', $client ?: $this->createMock(HttpClientInterface::class));
36+
return new GoogleChatTransport('My-Space', 'theAccessKey', 'theAccessToken=', $client ?? $this->createMock(HttpClientInterface::class));
3737
}
3838

3939
public function toStringProvider(): iterable

src/Symfony/Component/Notifier/Bridge/Infobip/Tests/InfobipTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class InfobipTransportTest extends TransportTestCase
2626
*/
2727
public function createTransport(?HttpClientInterface $client = null): TransportInterface
2828
{
29-
return (new InfobipTransport('authtoken', '0611223344', $client ?: $this->createMock(HttpClientInterface::class)))->setHost('host.test');
29+
return (new InfobipTransport('authtoken', '0611223344', $client ?? $this->createMock(HttpClientInterface::class)))->setHost('host.test');
3030
}
3131

3232
public function toStringProvider(): iterable

src/Symfony/Component/Notifier/Bridge/LinkedIn/Tests/LinkedInTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class LinkedInTransportTest extends TransportTestCase
2323
*/
2424
public function createTransport(?HttpClientInterface $client = null): TransportInterface
2525
{
26-
return (new LinkedInTransport('AuthToken', 'AccountId', $client ?: $this->createMock(HttpClientInterface::class)))->setHost('host.test');
26+
return (new LinkedInTransport('AuthToken', 'AccountId', $client ?? $this->createMock(HttpClientInterface::class)))->setHost('host.test');
2727
}
2828

2929
public function toStringProvider(): iterable

src/Symfony/Component/Notifier/Bridge/Mattermost/Tests/MattermostTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class MattermostTransportTest extends TransportTestCase
2929
*/
3030
public function createTransport(?HttpClientInterface $client = null): TransportInterface
3131
{
32-
return (new MattermostTransport('testAccessToken', 'testChannel', $client ?: $this->createMock(HttpClientInterface::class)))->setHost('host.test');
32+
return (new MattermostTransport('testAccessToken', 'testChannel', $client ?? $this->createMock(HttpClientInterface::class)))->setHost('host.test');
3333
}
3434

3535
public function toStringProvider(): iterable

src/Symfony/Component/Notifier/Bridge/Mobyt/Tests/MobytTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class MobytTransportTest extends TransportTestCase
3030
*/
3131
public function createTransport(?HttpClientInterface $client = null, string $messageType = MobytOptions::MESSAGE_TYPE_QUALITY_LOW): TransportInterface
3232
{
33-
return (new MobytTransport('accountSid', 'authToken', 'from', $messageType, $client ?: $this->createMock(HttpClientInterface::class)))->setHost('host.test');
33+
return (new MobytTransport('accountSid', 'authToken', 'from', $messageType, $client ?? $this->createMock(HttpClientInterface::class)))->setHost('host.test');
3434
}
3535

3636
public function toStringProvider(): iterable

src/Symfony/Component/Notifier/Bridge/Nexmo/Tests/NexmoTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class NexmoTransportTest extends TransportTestCase
2626
*/
2727
public function createTransport(?HttpClientInterface $client = null): TransportInterface
2828
{
29-
return new NexmoTransport('apiKey', 'apiSecret', 'sender', $client ?: $this->createMock(HttpClientInterface::class));
29+
return new NexmoTransport('apiKey', 'apiSecret', 'sender', $client ?? $this->createMock(HttpClientInterface::class));
3030
}
3131

3232
public function toStringProvider(): iterable

src/Symfony/Component/Notifier/Bridge/OvhCloud/Tests/OvhCloudTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class OvhCloudTransportTest extends TransportTestCase
2828
*/
2929
public function createTransport(?HttpClientInterface $client = null): TransportInterface
3030
{
31-
return new OvhCloudTransport('applicationKey', 'applicationSecret', 'consumerKey', 'serviceName', $client ?: $this->createMock(HttpClientInterface::class));
31+
return new OvhCloudTransport('applicationKey', 'applicationSecret', 'consumerKey', 'serviceName', $client ?? $this->createMock(HttpClientInterface::class));
3232
}
3333

3434
public function toStringProvider(): iterable

src/Symfony/Component/Notifier/Bridge/RocketChat/Tests/RocketChatTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class RocketChatTransportTest extends TransportTestCase
2929
*/
3030
public function createTransport(?HttpClientInterface $client = null, string $channel = null): TransportInterface
3131
{
32-
return new RocketChatTransport('testAccessToken', $channel, $client ?: $this->createMock(HttpClientInterface::class));
32+
return new RocketChatTransport('testAccessToken', $channel, $client ?? $this->createMock(HttpClientInterface::class));
3333
}
3434

3535
public function toStringProvider(): iterable

src/Symfony/Component/Notifier/Bridge/Sendinblue/Tests/SendinblueTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class SendinblueTransportTest extends TransportTestCase
2929
*/
3030
public function createTransport(?HttpClientInterface $client = null): TransportInterface
3131
{
32-
return (new SendinblueTransport('api-key', '0611223344', $client ?: $this->createMock(HttpClientInterface::class)))->setHost('host.test');
32+
return (new SendinblueTransport('api-key', '0611223344', $client ?? $this->createMock(HttpClientInterface::class)))->setHost('host.test');
3333
}
3434

3535
public function toStringProvider(): iterable

src/Symfony/Component/Notifier/Bridge/Sinch/Tests/SinchTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class SinchTransportTest extends TransportTestCase
2626
*/
2727
public function createTransport(?HttpClientInterface $client = null): TransportInterface
2828
{
29-
return new SinchTransport('accountSid', 'authToken', 'sender', $client ?: $this->createMock(HttpClientInterface::class));
29+
return new SinchTransport('accountSid', 'authToken', 'sender', $client ?? $this->createMock(HttpClientInterface::class));
3030
}
3131

3232
public function toStringProvider(): iterable

src/Symfony/Component/Notifier/Bridge/Slack/Tests/SlackTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ final class SlackTransportTest extends TransportTestCase
3333
*/
3434
public function createTransport(?HttpClientInterface $client = null, string $channel = null): TransportInterface
3535
{
36-
return new SlackTransport('testToken', $channel, $client ?: $this->createMock(HttpClientInterface::class));
36+
return new SlackTransport('testToken', $channel, $client ?? $this->createMock(HttpClientInterface::class));
3737
}
3838

3939
public function toStringProvider(): iterable

src/Symfony/Component/Notifier/Bridge/Smsapi/Tests/SmsapiTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class SmsapiTransportTest extends TransportTestCase
2626
*/
2727
public function createTransport(?HttpClientInterface $client = null): TransportInterface
2828
{
29-
return (new SmsapiTransport('testToken', 'testFrom', $client ?: $this->createMock(HttpClientInterface::class)))->setHost('test.host');
29+
return (new SmsapiTransport('testToken', 'testFrom', $client ?? $this->createMock(HttpClientInterface::class)))->setHost('test.host');
3030
}
3131

3232
public function toStringProvider(): iterable

src/Symfony/Component/Notifier/Bridge/Telegram/Tests/TelegramTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class TelegramTransportTest extends TransportTestCase
3030
*/
3131
public function createTransport(?HttpClientInterface $client = null, string $channel = null): TransportInterface
3232
{
33-
return new TelegramTransport('token', $channel, $client ?: $this->createMock(HttpClientInterface::class));
33+
return new TelegramTransport('token', $channel, $client ?? $this->createMock(HttpClientInterface::class));
3434
}
3535

3636
public function toStringProvider(): iterable

src/Symfony/Component/Notifier/Bridge/Twilio/Tests/TwilioTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class TwilioTransportTest extends TransportTestCase
2626
*/
2727
public function createTransport(?HttpClientInterface $client = null): TransportInterface
2828
{
29-
return new TwilioTransport('accountSid', 'authToken', 'from', $client ?: $this->createMock(HttpClientInterface::class));
29+
return new TwilioTransport('accountSid', 'authToken', 'from', $client ?? $this->createMock(HttpClientInterface::class));
3030
}
3131

3232
public function toStringProvider(): iterable

src/Symfony/Component/Notifier/Bridge/Zulip/Tests/ZulipTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class ZulipTransportTest extends TransportTestCase
2626
*/
2727
public function createTransport(?HttpClientInterface $client = null): TransportInterface
2828
{
29-
return (new ZulipTransport('testEmail', 'testToken', 'testChannel', $client ?: $this->createMock(HttpClientInterface::class)))->setHost('test.host');
29+
return (new ZulipTransport('testEmail', 'testToken', 'testChannel', $client ?? $this->createMock(HttpClientInterface::class)))->setHost('test.host');
3030
}
3131

3232
public function toStringProvider(): iterable

0 commit comments

Comments
 (0)