Merge branch '5.2' into 5.x

* 5.2:
  [CS] [5.2] Replace easy occurrences of ?: with ??
This commit is contained in:
Alexander M. Turek 2021-04-07 18:44:23 +02:00
commit fe9b188e28
24 changed files with 27 additions and 27 deletions

View File

@ -53,8 +53,8 @@ abstract class AbstractBrowser
public function __construct(array $server = [], History $history = null, CookieJar $cookieJar = null)
{
$this->setServerParameters($server);
$this->history = $history ?: new History();
$this->cookieJar = $cookieJar ?: new CookieJar();
$this->history = $history ?? new History();
$this->cookieJar = $cookieJar ?? new CookieJar();
}
/**

View File

@ -43,7 +43,7 @@ class RetryableHttpClient implements HttpClientInterface
$this->client = $client;
$this->strategy = $strategy ?? new GenericRetryStrategy();
$this->maxRetries = $maxRetries;
$this->logger = $logger ?: new NullLogger();
$this->logger = $logger ?? new NullLogger();
}
public function request(string $method, string $url, array $options = []): ResponseInterface

View File

@ -169,8 +169,8 @@ class AmazonSqsTransportTest extends TestCase
private function getTransport(SerializerInterface $serializer = null, Connection $connection = null)
{
$serializer = $serializer ?: $this->createMock(SerializerInterface::class);
$connection = $connection ?: $this->createMock(Connection::class);
$serializer = $serializer ?? $this->createMock(SerializerInterface::class);
$connection = $connection ?? $this->createMock(Connection::class);
return new AmazonSqsTransport($connection, $serializer);
}

View File

@ -117,7 +117,7 @@ class Connection
$this->autoSetupExchange = $this->autoSetup = $connectionOptions['auto_setup'] ?? true;
$this->exchangeOptions = $exchangeOptions;
$this->queuesOptions = $queuesOptions;
$this->amqpFactory = $amqpFactory ?: new AmqpFactory();
$this->amqpFactory = $amqpFactory ?? new AmqpFactory();
}
/**

View File

@ -71,8 +71,8 @@ class DoctrineTransportTest extends TestCase
private function getTransport(SerializerInterface $serializer = null, Connection $connection = null): DoctrineTransport
{
$serializer = $serializer ?: $this->createMock(SerializerInterface::class);
$connection = $connection ?: $this->createMock(Connection::class);
$serializer = $serializer ?? $this->createMock(SerializerInterface::class);
$connection = $connection ?? $this->createMock(Connection::class);
return new DoctrineTransport($connection, $serializer);
}

View File

@ -30,7 +30,7 @@ final class DiscordTransportTest extends TransportTestCase
*/
public function createTransport(?HttpClientInterface $client = null): TransportInterface
{
return (new DiscordTransport('testToken', 'testWebhookId', $client ?: $this->createMock(HttpClientInterface::class)))->setHost('host.test');
return (new DiscordTransport('testToken', 'testWebhookId', $client ?? $this->createMock(HttpClientInterface::class)))->setHost('host.test');
}
public function toStringProvider(): iterable

View File

@ -29,7 +29,7 @@ final class EsendexTransportTest extends TransportTestCase
*/
public function createTransport(?HttpClientInterface $client = null): TransportInterface
{
return (new EsendexTransport('email', 'password', 'testAccountReference', 'testFrom', $client ?: $this->createMock(HttpClientInterface::class)))->setHost('host.test');
return (new EsendexTransport('email', 'password', 'testAccountReference', 'testFrom', $client ?? $this->createMock(HttpClientInterface::class)))->setHost('host.test');
}
public function toStringProvider(): iterable

View File

@ -29,7 +29,7 @@ final class FirebaseTransportTest extends TransportTestCase
*/
public function createTransport(?HttpClientInterface $client = null): TransportInterface
{
return new FirebaseTransport('username:password', $client ?: $this->createMock(HttpClientInterface::class));
return new FirebaseTransport('username:password', $client ?? $this->createMock(HttpClientInterface::class));
}
public function toStringProvider(): iterable

View File

@ -26,7 +26,7 @@ final class FreeMobileTransportTest extends TransportTestCase
*/
public function createTransport(?HttpClientInterface $client = null): TransportInterface
{
return new FreeMobileTransport('login', 'pass', '0611223344', $client ?: $this->createMock(HttpClientInterface::class));
return new FreeMobileTransport('login', 'pass', '0611223344', $client ?? $this->createMock(HttpClientInterface::class));
}
public function toStringProvider(): iterable

View File

@ -33,7 +33,7 @@ final class GoogleChatTransportTest extends TransportTestCase
*/
public function createTransport(?HttpClientInterface $client = null, string $threadKey = null): TransportInterface
{
return new GoogleChatTransport('My-Space', 'theAccessKey', 'theAccessToken=', $threadKey, $client ?: $this->createMock(HttpClientInterface::class));
return new GoogleChatTransport('My-Space', 'theAccessKey', 'theAccessToken=', $threadKey, $client ?? $this->createMock(HttpClientInterface::class));
}
public function toStringProvider(): iterable

View File

@ -26,7 +26,7 @@ final class InfobipTransportTest extends TransportTestCase
*/
public function createTransport(?HttpClientInterface $client = null): TransportInterface
{
return (new InfobipTransport('authtoken', '0611223344', $client ?: $this->createMock(HttpClientInterface::class)))->setHost('host.test');
return (new InfobipTransport('authtoken', '0611223344', $client ?? $this->createMock(HttpClientInterface::class)))->setHost('host.test');
}
public function toStringProvider(): iterable

View File

@ -23,7 +23,7 @@ final class LinkedInTransportTest extends TransportTestCase
*/
public function createTransport(?HttpClientInterface $client = null): TransportInterface
{
return (new LinkedInTransport('AuthToken', 'AccountId', $client ?: $this->createMock(HttpClientInterface::class)))->setHost('host.test');
return (new LinkedInTransport('AuthToken', 'AccountId', $client ?? $this->createMock(HttpClientInterface::class)))->setHost('host.test');
}
public function toStringProvider(): iterable

View File

@ -29,7 +29,7 @@ final class MattermostTransportTest extends TransportTestCase
*/
public function createTransport(?HttpClientInterface $client = null): TransportInterface
{
return (new MattermostTransport('testAccessToken', 'testChannel', null, $client ?: $this->createMock(HttpClientInterface::class)))->setHost('host.test');
return (new MattermostTransport('testAccessToken', 'testChannel', null, $client ?? $this->createMock(HttpClientInterface::class)))->setHost('host.test');
}
public function toStringProvider(): iterable

View File

@ -30,7 +30,7 @@ final class MobytTransportTest extends TransportTestCase
*/
public function createTransport(?HttpClientInterface $client = null, string $messageType = MobytOptions::MESSAGE_TYPE_QUALITY_LOW): TransportInterface
{
return (new MobytTransport('accountSid', 'authToken', 'from', $messageType, $client ?: $this->createMock(HttpClientInterface::class)))->setHost('host.test');
return (new MobytTransport('accountSid', 'authToken', 'from', $messageType, $client ?? $this->createMock(HttpClientInterface::class)))->setHost('host.test');
}
public function toStringProvider(): iterable

View File

@ -26,7 +26,7 @@ final class NexmoTransportTest extends TransportTestCase
*/
public function createTransport(?HttpClientInterface $client = null): TransportInterface
{
return new NexmoTransport('apiKey', 'apiSecret', 'sender', $client ?: $this->createMock(HttpClientInterface::class));
return new NexmoTransport('apiKey', 'apiSecret', 'sender', $client ?? $this->createMock(HttpClientInterface::class));
}
public function toStringProvider(): iterable

View File

@ -28,7 +28,7 @@ final class OvhCloudTransportTest extends TransportTestCase
*/
public function createTransport(?HttpClientInterface $client = null, string $sender = null): TransportInterface
{
return (new OvhCloudTransport('applicationKey', 'applicationSecret', 'consumerKey', 'serviceName', $client ?: $this->createMock(HttpClientInterface::class)))->setSender($sender);
return (new OvhCloudTransport('applicationKey', 'applicationSecret', 'consumerKey', 'serviceName', $client ?? $this->createMock(HttpClientInterface::class)))->setSender($sender);
}
public function toStringProvider(): iterable

View File

@ -29,7 +29,7 @@ final class RocketChatTransportTest extends TransportTestCase
*/
public function createTransport(?HttpClientInterface $client = null, string $channel = null): TransportInterface
{
return new RocketChatTransport('testAccessToken', $channel, $client ?: $this->createMock(HttpClientInterface::class));
return new RocketChatTransport('testAccessToken', $channel, $client ?? $this->createMock(HttpClientInterface::class));
}
public function toStringProvider(): iterable

View File

@ -29,7 +29,7 @@ final class SendinblueTransportTest extends TransportTestCase
*/
public function createTransport(?HttpClientInterface $client = null): TransportInterface
{
return (new SendinblueTransport('api-key', '0611223344', $client ?: $this->createMock(HttpClientInterface::class)))->setHost('host.test');
return (new SendinblueTransport('api-key', '0611223344', $client ?? $this->createMock(HttpClientInterface::class)))->setHost('host.test');
}
public function toStringProvider(): iterable

View File

@ -26,7 +26,7 @@ final class SinchTransportTest extends TransportTestCase
*/
public function createTransport(?HttpClientInterface $client = null): TransportInterface
{
return new SinchTransport('accountSid', 'authToken', 'sender', $client ?: $this->createMock(HttpClientInterface::class));
return new SinchTransport('accountSid', 'authToken', 'sender', $client ?? $this->createMock(HttpClientInterface::class));
}
public function toStringProvider(): iterable

View File

@ -34,7 +34,7 @@ final class SlackTransportTest extends TransportTestCase
*/
public function createTransport(?HttpClientInterface $client = null, string $channel = null): TransportInterface
{
return new SlackTransport('xoxb-TestToken', $channel, $client ?: $this->createMock(HttpClientInterface::class));
return new SlackTransport('xoxb-TestToken', $channel, $client ?? $this->createMock(HttpClientInterface::class));
}
public function toStringProvider(): iterable

View File

@ -26,7 +26,7 @@ final class SmsapiTransportTest extends TransportTestCase
*/
public function createTransport(?HttpClientInterface $client = null): TransportInterface
{
return (new SmsapiTransport('testToken', 'testFrom', $client ?: $this->createMock(HttpClientInterface::class)))->setHost('test.host');
return (new SmsapiTransport('testToken', 'testFrom', $client ?? $this->createMock(HttpClientInterface::class)))->setHost('test.host');
}
public function toStringProvider(): iterable

View File

@ -30,7 +30,7 @@ final class TelegramTransportTest extends TransportTestCase
*/
public function createTransport(?HttpClientInterface $client = null, string $channel = null): TransportInterface
{
return new TelegramTransport('token', $channel, $client ?: $this->createMock(HttpClientInterface::class));
return new TelegramTransport('token', $channel, $client ?? $this->createMock(HttpClientInterface::class));
}
public function toStringProvider(): iterable

View File

@ -26,7 +26,7 @@ final class TwilioTransportTest extends TransportTestCase
*/
public function createTransport(?HttpClientInterface $client = null): TransportInterface
{
return new TwilioTransport('accountSid', 'authToken', 'from', $client ?: $this->createMock(HttpClientInterface::class));
return new TwilioTransport('accountSid', 'authToken', 'from', $client ?? $this->createMock(HttpClientInterface::class));
}
public function toStringProvider(): iterable

View File

@ -26,7 +26,7 @@ final class ZulipTransportTest extends TransportTestCase
*/
public function createTransport(?HttpClientInterface $client = null): TransportInterface
{
return (new ZulipTransport('testEmail', 'testToken', 'testChannel', $client ?: $this->createMock(HttpClientInterface::class)))->setHost('test.host');
return (new ZulipTransport('testEmail', 'testToken', 'testChannel', $client ?? $this->createMock(HttpClientInterface::class)))->setHost('test.host');
}
public function toStringProvider(): iterable