From 0fdf59c26dec4f996bcfdd1eac0ce2d199fc1d10 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 5 Jan 2021 10:01:01 +0100 Subject: [PATCH] fix code style --- .../HttpCodeActivationStrategyTest.php | 10 +++++----- .../NotFoundActivationStrategyTest.php | 4 ++-- .../Fixtures/php/http_client_retry.php | 2 +- .../php/workflow_with_no_events_to_dispatch.php | 8 ++++---- .../workflow_with_specified_events_to_dispatch.php | 8 ++++---- .../DependencyInjection/FrameworkExtensionTest.php | 2 +- .../DependencyInjection/SecurityExtensionTest.php | 2 +- .../Component/BrowserKit/Tests/RequestTest.php | 2 +- .../Component/Config/Definition/ArrayNode.php | 2 +- .../Tests/SignalRegistry/SignalRegistryTest.php | 10 +++++----- .../HttpClient/Response/TraceableResponse.php | 2 ++ .../HttpClient/Tests/Response/MockResponseTest.php | 2 +- .../Lock/Tests/Store/PostgreSqlDbalStoreTest.php | 2 +- .../Lock/Tests/Store/PostgreSqlStoreTest.php | 2 +- .../Tests/Transport/AmazonSqsSenderTest.php | 4 ++-- .../Bridge/Amqp/Tests/Transport/ConnectionTest.php | 2 +- .../AddErrorDetailsStampListenerTest.php | 2 +- .../Tests/Stamp/ErrorDetailsStampTest.php | 6 +++--- .../Notifier/Tests/Transport/TransportsTest.php | 8 ++++---- .../Notifier/Tests/TransportFactoryTestCase.php | 8 ++++---- .../Component/Notifier/Tests/TransportTestCase.php | 14 +++++++------- .../Tests/Extractor/ConstructorExtractorTest.php | 2 +- .../PropertyInfo/Util/PhpDocTypeHelper.php | 2 +- .../Authentication/AuthenticatorManagerTest.php | 4 ++-- .../Factory/ClassMetadataFactoryCompilerTest.php | 2 +- .../Factory/CompiledClassMetadataFactoryTest.php | 2 +- .../MetadataAwareNameConverterTest.php | 2 +- .../Tests/Normalizer/AbstractNormalizerTest.php | 2 +- .../Normalizer/GetSetMethodNormalizerTest.php | 2 +- .../Tests/Normalizer/PropertyNormalizerTest.php | 2 +- .../Tests/Normalizer/UidNormalizerTest.php | 1 - .../Tests/PseudoLocalizationTranslatorTest.php | 4 ++-- .../Component/Validator/Constraints/Regex.php | 2 +- .../Component/Validator/Constraints/Timezone.php | 2 +- .../Component/Validator/Constraints/Type.php | 2 +- .../Validator/Tests/Command/DebugCommandTest.php | 6 +++--- .../Tests/Constraints/LanguageValidatorTest.php | 1 - .../Tests/Fixtures/ConstraintChoiceWithPreset.php | 5 +++-- 38 files changed, 73 insertions(+), 72 deletions(-) diff --git a/src/Symfony/Bridge/Monolog/Tests/Handler/FingersCrossed/HttpCodeActivationStrategyTest.php b/src/Symfony/Bridge/Monolog/Tests/Handler/FingersCrossed/HttpCodeActivationStrategyTest.php index fdf2811876..fedbb83482 100644 --- a/src/Symfony/Bridge/Monolog/Tests/Handler/FingersCrossed/HttpCodeActivationStrategyTest.php +++ b/src/Symfony/Bridge/Monolog/Tests/Handler/FingersCrossed/HttpCodeActivationStrategyTest.php @@ -24,7 +24,7 @@ class HttpCodeActivationStrategyTest extends TestCase /** * @group legacy */ - public function testExclusionsWithoutCodeLegacy(): void + public function testExclusionsWithoutCodeLegacy() { $this->expectException('LogicException'); new HttpCodeActivationStrategy(new RequestStack(), [['urls' => []]], Logger::WARNING); @@ -33,7 +33,7 @@ class HttpCodeActivationStrategyTest extends TestCase /** * @group legacy */ - public function testExclusionsWithoutUrlsLegacy(): void + public function testExclusionsWithoutUrlsLegacy() { $this->expectException('LogicException'); new HttpCodeActivationStrategy(new RequestStack(), [['code' => 404]], Logger::WARNING); @@ -44,7 +44,7 @@ class HttpCodeActivationStrategyTest extends TestCase * * @group legacy */ - public function testIsActivatedLegacy($url, $record, $expected): void + public function testIsActivatedLegacy($url, $record, $expected) { $requestStack = new RequestStack(); $requestStack->push(Request::create($url)); @@ -63,13 +63,13 @@ class HttpCodeActivationStrategyTest extends TestCase self::assertEquals($expected, $strategy->isHandlerActivated($record)); } - public function testExclusionsWithoutCode(): void + public function testExclusionsWithoutCode() { $this->expectException('LogicException'); new HttpCodeActivationStrategy(new RequestStack(), [['urls' => []]], new ErrorLevelActivationStrategy(Logger::WARNING)); } - public function testExclusionsWithoutUrls(): void + public function testExclusionsWithoutUrls() { $this->expectException('LogicException'); new HttpCodeActivationStrategy(new RequestStack(), [['code' => 404]], new ErrorLevelActivationStrategy(Logger::WARNING)); diff --git a/src/Symfony/Bridge/Monolog/Tests/Handler/FingersCrossed/NotFoundActivationStrategyTest.php b/src/Symfony/Bridge/Monolog/Tests/Handler/FingersCrossed/NotFoundActivationStrategyTest.php index 3d8445df3b..a60cc450c7 100644 --- a/src/Symfony/Bridge/Monolog/Tests/Handler/FingersCrossed/NotFoundActivationStrategyTest.php +++ b/src/Symfony/Bridge/Monolog/Tests/Handler/FingersCrossed/NotFoundActivationStrategyTest.php @@ -26,7 +26,7 @@ class NotFoundActivationStrategyTest extends TestCase * * @group legacy */ - public function testIsActivatedLegacy(string $url, array $record, bool $expected): void + public function testIsActivatedLegacy(string $url, array $record, bool $expected) { $requestStack = new RequestStack(); $requestStack->push(Request::create($url)); @@ -39,7 +39,7 @@ class NotFoundActivationStrategyTest extends TestCase /** * @dataProvider isActivatedProvider */ - public function testIsActivated(string $url, array $record, bool $expected): void + public function testIsActivated(string $url, array $record, bool $expected) { $requestStack = new RequestStack(); $requestStack->push(Request::create($url)); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/http_client_retry.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/http_client_retry.php index 3260ac56a7..f2ab01d1e1 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/http_client_retry.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/http_client_retry.php @@ -11,7 +11,7 @@ $container->loadFromExtension('framework', [ 'multiplier' => 2, 'max_delay' => 0, 'jitter' => 0.3, - ] + ], ], 'scoped_clients' => [ 'foo' => [ diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_no_events_to_dispatch.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_no_events_to_dispatch.php index 0ae6ac69ee..e4eefd4c28 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_no_events_to_dispatch.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_no_events_to_dispatch.php @@ -8,7 +8,7 @@ $container->loadFromExtension('framework', [ 'type' => 'state_machine', 'marking_store' => [ 'type' => 'method', - 'property' => 'state' + 'property' => 'state', ], 'supports' => [ FrameworkExtensionTest::class, @@ -33,9 +33,9 @@ $container->loadFromExtension('framework', [ 'two', ], 'to' => [ - 'three' - ] - ] + 'three', + ], + ], ], ], ], diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_specified_events_to_dispatch.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_specified_events_to_dispatch.php index 259ee5087f..0fc5c29c8b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_specified_events_to_dispatch.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_specified_events_to_dispatch.php @@ -8,7 +8,7 @@ $container->loadFromExtension('framework', [ 'type' => 'state_machine', 'marking_store' => [ 'type' => 'method', - 'property' => 'state' + 'property' => 'state', ], 'supports' => [ FrameworkExtensionTest::class, @@ -36,9 +36,9 @@ $container->loadFromExtension('framework', [ 'two', ], 'to' => [ - 'three' - ] - ] + 'three', + ], + ], ], ], ], diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index 72dc6db357..f2bd9a99db 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -1371,7 +1371,7 @@ abstract class FrameworkExtensionTest extends TestCase $this->assertEquals($expected, $chain->getArguments()); } - public function testRedisTagAwareAdapter(): void + public function testRedisTagAwareAdapter() { $container = $this->createContainerFromFile('cache', [], true); diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php index 61e6287768..7c3443a06d 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php @@ -629,7 +629,7 @@ class SecurityExtensionTest extends TestCase yield [['user_checker' => TestUserChecker::class], TestUserChecker::class]; } - public function testConfigureCustomFirewallListener(): void + public function testConfigureCustomFirewallListener() { $container = $this->getRawContainer(); /** @var SecurityExtension $extension */ diff --git a/src/Symfony/Component/BrowserKit/Tests/RequestTest.php b/src/Symfony/Component/BrowserKit/Tests/RequestTest.php index 5d7c7d6b89..a7327b0f32 100644 --- a/src/Symfony/Component/BrowserKit/Tests/RequestTest.php +++ b/src/Symfony/Component/BrowserKit/Tests/RequestTest.php @@ -52,7 +52,7 @@ class RequestTest extends TestCase $this->assertEquals(['foo' => 'bar'], $request->getServer(), '->getServer() returns the server parameters of the request'); } - public function testAllParameterValuesAreConvertedToString(): void + public function testAllParameterValuesAreConvertedToString() { $parameters = [ 'foo' => 1, diff --git a/src/Symfony/Component/Config/Definition/ArrayNode.php b/src/Symfony/Component/Config/Definition/ArrayNode.php index 66291014ec..2f8fa75251 100644 --- a/src/Symfony/Component/Config/Definition/ArrayNode.php +++ b/src/Symfony/Component/Config/Definition/ArrayNode.php @@ -215,7 +215,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface if ($child->isRequired()) { $message = sprintf('The child config "%s" under "%s" must be configured', $name, $this->getPath()); if ($child->getInfo()) { - $message .= sprintf(": %s", $child->getInfo()); + $message .= sprintf(': %s', $child->getInfo()); } else { $message .= '.'; } diff --git a/src/Symfony/Component/Console/Tests/SignalRegistry/SignalRegistryTest.php b/src/Symfony/Component/Console/Tests/SignalRegistry/SignalRegistryTest.php index 56f7d44443..f1ac7c6900 100644 --- a/src/Symfony/Component/Console/Tests/SignalRegistry/SignalRegistryTest.php +++ b/src/Symfony/Component/Console/Tests/SignalRegistry/SignalRegistryTest.php @@ -26,7 +26,7 @@ class SignalRegistryTest extends TestCase pcntl_signal(\SIGUSR2, \SIG_DFL); } - public function testOneCallbackForASignal_signalIsHandled() + public function testOneCallbackForASignalSignalIsHandled() { $signalRegistry = new SignalRegistry(); @@ -40,7 +40,7 @@ class SignalRegistryTest extends TestCase $this->assertTrue($isHandled); } - public function testTwoCallbacksForASignal_bothCallbacksAreCalled() + public function testTwoCallbacksForASignalBothCallbacksAreCalled() { $signalRegistry = new SignalRegistry(); @@ -60,7 +60,7 @@ class SignalRegistryTest extends TestCase $this->assertTrue($isHandled2); } - public function testTwoSignals_signalsAreHandled() + public function testTwoSignalsSignalsAreHandled() { $signalRegistry = new SignalRegistry(); @@ -85,7 +85,7 @@ class SignalRegistryTest extends TestCase $this->assertTrue($isHandled2); } - public function testTwoCallbacksForASignal_previousAndRegisteredCallbacksWereCalled() + public function testTwoCallbacksForASignalPreviousAndRegisteredCallbacksWereCalled() { $signalRegistry = new SignalRegistry(); @@ -105,7 +105,7 @@ class SignalRegistryTest extends TestCase $this->assertTrue($isHandled2); } - public function testTwoCallbacksForASignal_previousCallbackFromAnotherRegistry() + public function testTwoCallbacksForASignalPreviousCallbackFromAnotherRegistry() { $signalRegistry1 = new SignalRegistry(); diff --git a/src/Symfony/Component/HttpClient/Response/TraceableResponse.php b/src/Symfony/Component/HttpClient/Response/TraceableResponse.php index 9e1a2d5e01..7e58e06b30 100644 --- a/src/Symfony/Component/HttpClient/Response/TraceableResponse.php +++ b/src/Symfony/Component/HttpClient/Response/TraceableResponse.php @@ -83,6 +83,7 @@ class TraceableResponse implements ResponseInterface, StreamableInterface if (false === $this->content) { return $this->response->getContent($throw); } + return $this->content = $this->response->getContent(false); } finally { if ($this->event && $this->event->isStarted()) { @@ -100,6 +101,7 @@ class TraceableResponse implements ResponseInterface, StreamableInterface if (false === $this->content) { return $this->response->toArray($throw); } + return $this->content = $this->response->toArray(false); } finally { if ($this->event && $this->event->isStarted()) { diff --git a/src/Symfony/Component/HttpClient/Tests/Response/MockResponseTest.php b/src/Symfony/Component/HttpClient/Tests/Response/MockResponseTest.php index a1b30c77c3..2ad9a1c379 100644 --- a/src/Symfony/Component/HttpClient/Tests/Response/MockResponseTest.php +++ b/src/Symfony/Component/HttpClient/Tests/Response/MockResponseTest.php @@ -33,7 +33,7 @@ class MockResponseTest extends TestCase $response->toArray(); } - public function testUrlHttpMethodMockResponse(): void + public function testUrlHttpMethodMockResponse() { $responseMock = new MockResponse(json_encode(['foo' => 'bar'])); $url = 'https://example.com/some-endpoint'; diff --git a/src/Symfony/Component/Lock/Tests/Store/PostgreSqlDbalStoreTest.php b/src/Symfony/Component/Lock/Tests/Store/PostgreSqlDbalStoreTest.php index 4c8ec0f7a1..6c007fabb3 100644 --- a/src/Symfony/Component/Lock/Tests/Store/PostgreSqlDbalStoreTest.php +++ b/src/Symfony/Component/Lock/Tests/Store/PostgreSqlDbalStoreTest.php @@ -24,8 +24,8 @@ use Symfony\Component\Lock\Store\PostgreSqlStore; */ class PostgreSqlDbalStoreTest extends AbstractStoreTest { - use SharedLockStoreTestTrait; use BlockingStoreTestTrait; + use SharedLockStoreTestTrait; /** * {@inheritdoc} diff --git a/src/Symfony/Component/Lock/Tests/Store/PostgreSqlStoreTest.php b/src/Symfony/Component/Lock/Tests/Store/PostgreSqlStoreTest.php index 3515f72a9e..d0358a8ef0 100644 --- a/src/Symfony/Component/Lock/Tests/Store/PostgreSqlStoreTest.php +++ b/src/Symfony/Component/Lock/Tests/Store/PostgreSqlStoreTest.php @@ -24,8 +24,8 @@ use Symfony\Component\Lock\Store\PostgreSqlStore; */ class PostgreSqlStoreTest extends AbstractStoreTest { - use SharedLockStoreTestTrait; use BlockingStoreTestTrait; + use SharedLockStoreTestTrait; /** * {@inheritdoc} diff --git a/src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Transport/AmazonSqsSenderTest.php b/src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Transport/AmazonSqsSenderTest.php index 412faf0807..6c3ac392bb 100644 --- a/src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Transport/AmazonSqsSenderTest.php +++ b/src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Transport/AmazonSqsSenderTest.php @@ -21,7 +21,7 @@ use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface; class AmazonSqsSenderTest extends TestCase { - public function testSend(): void + public function testSend() { $envelope = new Envelope(new DummyMessage('Oy')); $encoded = ['body' => '...', 'headers' => ['type' => DummyMessage::class]]; @@ -38,7 +38,7 @@ class AmazonSqsSenderTest extends TestCase $sender->send($envelope); } - public function testSendWithAmazonSqsFifoStamp(): void + public function testSendWithAmazonSqsFifoStamp() { $envelope = (new Envelope(new DummyMessage('Oy'))) ->with($stamp = new AmazonSqsFifoStamp('testGroup', 'testDeduplicationId')); diff --git a/src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/ConnectionTest.php b/src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/ConnectionTest.php index 36fde12505..3d9f415533 100644 --- a/src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/ConnectionTest.php +++ b/src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/ConnectionTest.php @@ -347,7 +347,7 @@ class ConnectionTest extends TestCase $factory->method('createQueue')->will($this->onConsecutiveCalls($amqpQueue0, $amqpQueue1)); $amqpExchange->expects($this->once())->method('declareExchange'); - $amqpExchange->expects($this->once())->method('publish')->with('body', 'routing_key', AMQP_NOPARAM, ['headers' => [], 'delivery_mode' => 2, 'timestamp' => time()]); + $amqpExchange->expects($this->once())->method('publish')->with('body', 'routing_key', \AMQP_NOPARAM, ['headers' => [], 'delivery_mode' => 2, 'timestamp' => time()]); $amqpQueue0->expects($this->once())->method('declareQueue'); $amqpQueue0->expects($this->exactly(2))->method('bind')->withConsecutive( [self::DEFAULT_EXCHANGE_NAME, 'binding_key0'], diff --git a/src/Symfony/Component/Messenger/Tests/EventListener/AddErrorDetailsStampListenerTest.php b/src/Symfony/Component/Messenger/Tests/EventListener/AddErrorDetailsStampListenerTest.php index cc01567a3d..d63fcf8ef6 100644 --- a/src/Symfony/Component/Messenger/Tests/EventListener/AddErrorDetailsStampListenerTest.php +++ b/src/Symfony/Component/Messenger/Tests/EventListener/AddErrorDetailsStampListenerTest.php @@ -10,7 +10,7 @@ use Symfony\Component\Messenger\Stamp\ErrorDetailsStamp; final class AddErrorDetailsStampListenerTest extends TestCase { - public function testExceptionDetailsAreAdded(): void + public function testExceptionDetailsAreAdded() { $listener = new AddErrorDetailsStampListener(); diff --git a/src/Symfony/Component/Messenger/Tests/Stamp/ErrorDetailsStampTest.php b/src/Symfony/Component/Messenger/Tests/Stamp/ErrorDetailsStampTest.php index 98277931da..8d66537afa 100644 --- a/src/Symfony/Component/Messenger/Tests/Stamp/ErrorDetailsStampTest.php +++ b/src/Symfony/Component/Messenger/Tests/Stamp/ErrorDetailsStampTest.php @@ -25,7 +25,7 @@ use Symfony\Component\Serializer\Serializer as SymfonySerializer; class ErrorDetailsStampTest extends TestCase { - public function testGetters(): void + public function testGetters() { $exception = new \Exception('exception message'); $flattenException = FlattenException::createFromThrowable($exception); @@ -37,7 +37,7 @@ class ErrorDetailsStampTest extends TestCase $this->assertEquals($flattenException, $stamp->getFlattenException()); } - public function testUnwrappingHandlerFailedException(): void + public function testUnwrappingHandlerFailedException() { $wrappedException = new \Exception('I am inside', 123); $envelope = new Envelope(new \stdClass()); @@ -52,7 +52,7 @@ class ErrorDetailsStampTest extends TestCase $this->assertEquals($flattenException, $stamp->getFlattenException()); } - public function testDeserialization(): void + public function testDeserialization() { $exception = new \Exception('exception message'); $stamp = ErrorDetailsStamp::create($exception); diff --git a/src/Symfony/Component/Notifier/Tests/Transport/TransportsTest.php b/src/Symfony/Component/Notifier/Tests/Transport/TransportsTest.php index de3cc3fab8..f6eb36bb21 100644 --- a/src/Symfony/Component/Notifier/Tests/Transport/TransportsTest.php +++ b/src/Symfony/Component/Notifier/Tests/Transport/TransportsTest.php @@ -21,7 +21,7 @@ use Symfony\Component\Notifier\Transport\Transports; class TransportsTest extends TestCase { - public function testSendToTransportDefinedByMessage(): void + public function testSendToTransportDefinedByMessage() { $transports = new Transports([ 'one' => $one = $this->createMock(TransportInterface::class), @@ -39,7 +39,7 @@ class TransportsTest extends TestCase $this->assertSame('one', $sentMessage->getTransport()); } - public function testSendToFirstSupportedTransportIfMessageDoesNotDefineATransport(): void + public function testSendToFirstSupportedTransportIfMessageDoesNotDefineATransport() { $transports = new Transports([ 'one' => $one = $this->createMock(TransportInterface::class), @@ -63,7 +63,7 @@ class TransportsTest extends TestCase $this->assertSame('two', $sentMessage->getTransport()); } - public function testThrowExceptionIfNoSupportedTransportWasFound(): void + public function testThrowExceptionIfNoSupportedTransportWasFound() { $transports = new Transports([ 'one' => $one = $this->createMock(TransportInterface::class), @@ -79,7 +79,7 @@ class TransportsTest extends TestCase $transports->send($message); } - public function testThrowExceptionIfTransportDefinedByMessageIsNotSupported(): void + public function testThrowExceptionIfTransportDefinedByMessageIsNotSupported() { $transports = new Transports([ 'one' => $one = $this->createMock(TransportInterface::class), diff --git a/src/Symfony/Component/Notifier/Tests/TransportFactoryTestCase.php b/src/Symfony/Component/Notifier/Tests/TransportFactoryTestCase.php index db415975b2..be3da0ff34 100644 --- a/src/Symfony/Component/Notifier/Tests/TransportFactoryTestCase.php +++ b/src/Symfony/Component/Notifier/Tests/TransportFactoryTestCase.php @@ -55,7 +55,7 @@ abstract class TransportFactoryTestCase extends TestCase /** * @dataProvider supportsProvider */ - public function testSupports(bool $expected, string $dsn): void + public function testSupports(bool $expected, string $dsn) { $factory = $this->createFactory(); @@ -65,7 +65,7 @@ abstract class TransportFactoryTestCase extends TestCase /** * @dataProvider createProvider */ - public function testCreate(string $expected, string $dsn): void + public function testCreate(string $expected, string $dsn) { $factory = $this->createFactory(); $transport = $factory->create(Dsn::fromString($dsn)); @@ -76,7 +76,7 @@ abstract class TransportFactoryTestCase extends TestCase /** * @dataProvider unsupportedSchemeProvider */ - public function testUnsupportedSchemeException(string $dsn, string $message = null): void + public function testUnsupportedSchemeException(string $dsn, string $message = null) { $factory = $this->createFactory(); @@ -93,7 +93,7 @@ abstract class TransportFactoryTestCase extends TestCase /** * @dataProvider incompleteDsnProvider */ - public function testIncompleteDsnException(string $dsn, string $message = null): void + public function testIncompleteDsnException(string $dsn, string $message = null) { $factory = $this->createFactory(); diff --git a/src/Symfony/Component/Notifier/Tests/TransportTestCase.php b/src/Symfony/Component/Notifier/Tests/TransportTestCase.php index d55d5b670f..18f2d40d3a 100644 --- a/src/Symfony/Component/Notifier/Tests/TransportTestCase.php +++ b/src/Symfony/Component/Notifier/Tests/TransportTestCase.php @@ -47,7 +47,7 @@ abstract class TransportTestCase extends TestCase /** * @dataProvider toStringProvider */ - public function testToString(string $expected, TransportInterface $transport): void + public function testToString(string $expected, TransportInterface $transport) { $this->assertSame($expected, (string) $transport); } @@ -55,7 +55,7 @@ abstract class TransportTestCase extends TestCase /** * @dataProvider supportedMessagesProvider */ - public function testSupportedMessages(MessageInterface $message, ?TransportInterface $transport = null): void + public function testSupportedMessages(MessageInterface $message, ?TransportInterface $transport = null) { if (null === $transport) { $transport = $this->createTransport(); @@ -67,7 +67,7 @@ abstract class TransportTestCase extends TestCase /** * @dataProvider unsupportedMessagesProvider */ - public function testUnsupportedMessages(MessageInterface $message, ?TransportInterface $transport = null): void + public function testUnsupportedMessages(MessageInterface $message, ?TransportInterface $transport = null) { if (null === $transport) { $transport = $this->createTransport(); @@ -79,7 +79,7 @@ abstract class TransportTestCase extends TestCase /** * @dataProvider unsupportedMessagesProvider */ - public function testUnsupportedMessagesTrowLogicExceptionWhenSend(MessageInterface $message, ?TransportInterface $transport = null): void + public function testUnsupportedMessagesTrowLogicExceptionWhenSend(MessageInterface $message, ?TransportInterface $transport = null) { if (null === $transport) { $transport = $this->createTransport(); @@ -90,7 +90,7 @@ abstract class TransportTestCase extends TestCase $transport->send($message); } - public function testCanSetCustomHost(): void + public function testCanSetCustomHost() { $transport = $this->createTransport(); @@ -99,7 +99,7 @@ abstract class TransportTestCase extends TestCase $this->assertStringContainsString(sprintf('://%s', $customHost), (string) $transport); } - public function testCanSetCustomPort(): void + public function testCanSetCustomPort() { $transport = $this->createTransport(); @@ -111,7 +111,7 @@ abstract class TransportTestCase extends TestCase $this->assertMatchesRegularExpression(sprintf('/^.*\/\/.*\:%s.*$/', $customPort), (string) $transport); } - public function testCanSetCustomHostAndPort(): void + public function testCanSetCustomHostAndPort() { $transport = $this->createTransport(); diff --git a/src/Symfony/Component/PropertyInfo/Tests/Extractor/ConstructorExtractorTest.php b/src/Symfony/Component/PropertyInfo/Tests/Extractor/ConstructorExtractorTest.php index 7c3631db27..c26c1b24b9 100644 --- a/src/Symfony/Component/PropertyInfo/Tests/Extractor/ConstructorExtractorTest.php +++ b/src/Symfony/Component/PropertyInfo/Tests/Extractor/ConstructorExtractorTest.php @@ -41,7 +41,7 @@ class ConstructorExtractorTest extends TestCase $this->assertEquals([new Type(Type::BUILTIN_TYPE_STRING)], $this->extractor->getTypes('Foo', 'bar', [])); } - public function testGetTypes_ifNoExtractors() + public function testGetTypesIfNoExtractors() { $extractor = new ConstructorExtractor([]); $this->assertNull($extractor->getTypes('Foo', 'bar', [])); diff --git a/src/Symfony/Component/PropertyInfo/Util/PhpDocTypeHelper.php b/src/Symfony/Component/PropertyInfo/Util/PhpDocTypeHelper.php index 8744a33ce7..381f801275 100644 --- a/src/Symfony/Component/PropertyInfo/Util/PhpDocTypeHelper.php +++ b/src/Symfony/Component/PropertyInfo/Util/PhpDocTypeHelper.php @@ -122,7 +122,7 @@ final class PhpDocTypeHelper $collectionKeyType = $this->getTypes($type->getKeyType())[0]; $collectionValueTypes = $this->getTypes($type->getValueType()); - if (\count($collectionValueTypes) != 1) { + if (1 != \count($collectionValueTypes)) { // the Type class does not support union types yet, so assume that no type was defined $collectionValueType = null; } else { diff --git a/src/Symfony/Component/Security/Http/Tests/Authentication/AuthenticatorManagerTest.php b/src/Symfony/Component/Security/Http/Tests/Authentication/AuthenticatorManagerTest.php index 2802fac484..cccb28743f 100644 --- a/src/Symfony/Component/Security/Http/Tests/Authentication/AuthenticatorManagerTest.php +++ b/src/Symfony/Component/Security/Http/Tests/Authentication/AuthenticatorManagerTest.php @@ -156,7 +156,7 @@ class AuthenticatorManagerTest extends TestCase yield [false]; } - public function testAuthenticateRequestCanModifyTokenFromEvent(): void + public function testAuthenticateRequestCanModifyTokenFromEvent() { $authenticator = $this->createAuthenticator(); $this->request->attributes->set('_security_authenticators', [$authenticator]); @@ -191,7 +191,7 @@ class AuthenticatorManagerTest extends TestCase $manager->authenticateUser($this->user, $authenticator, $this->request); } - public function testAuthenticateUserCanModifyTokenFromEvent(): void + public function testAuthenticateUserCanModifyTokenFromEvent() { $authenticator = $this->createAuthenticator(); $authenticator->expects($this->any())->method('createAuthenticatedToken')->willReturn($this->token); diff --git a/src/Symfony/Component/Serializer/Tests/Mapping/Factory/ClassMetadataFactoryCompilerTest.php b/src/Symfony/Component/Serializer/Tests/Mapping/Factory/ClassMetadataFactoryCompilerTest.php index 2ce24718df..af628eb772 100644 --- a/src/Symfony/Component/Serializer/Tests/Mapping/Factory/ClassMetadataFactoryCompilerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Mapping/Factory/ClassMetadataFactoryCompilerTest.php @@ -7,9 +7,9 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory; use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryCompiler; use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader; -use Symfony\Component\Serializer\Tests\Fixtures\Dummy; use Symfony\Component\Serializer\Tests\Fixtures\Annotations\MaxDepthDummy; use Symfony\Component\Serializer\Tests\Fixtures\Annotations\SerializedNameDummy; +use Symfony\Component\Serializer\Tests\Fixtures\Dummy; final class ClassMetadataFactoryCompilerTest extends TestCase { diff --git a/src/Symfony/Component/Serializer/Tests/Mapping/Factory/CompiledClassMetadataFactoryTest.php b/src/Symfony/Component/Serializer/Tests/Mapping/Factory/CompiledClassMetadataFactoryTest.php index 034e8aa088..06ea7c7e86 100644 --- a/src/Symfony/Component/Serializer/Tests/Mapping/Factory/CompiledClassMetadataFactoryTest.php +++ b/src/Symfony/Component/Serializer/Tests/Mapping/Factory/CompiledClassMetadataFactoryTest.php @@ -7,8 +7,8 @@ use Symfony\Component\Serializer\Mapping\AttributeMetadata; use Symfony\Component\Serializer\Mapping\ClassMetadata; use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface; use Symfony\Component\Serializer\Mapping\Factory\CompiledClassMetadataFactory; -use Symfony\Component\Serializer\Tests\Fixtures\Dummy; use Symfony\Component\Serializer\Tests\Fixtures\Annotations\SerializedNameDummy; +use Symfony\Component\Serializer\Tests\Fixtures\Dummy; /** * @author Fabien Bourigault diff --git a/src/Symfony/Component/Serializer/Tests/NameConverter/MetadataAwareNameConverterTest.php b/src/Symfony/Component/Serializer/Tests/NameConverter/MetadataAwareNameConverterTest.php index ba20bc7b0d..250f6be40e 100644 --- a/src/Symfony/Component/Serializer/Tests/NameConverter/MetadataAwareNameConverterTest.php +++ b/src/Symfony/Component/Serializer/Tests/NameConverter/MetadataAwareNameConverterTest.php @@ -18,8 +18,8 @@ use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface; use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader; use Symfony\Component\Serializer\NameConverter\MetadataAwareNameConverter; use Symfony\Component\Serializer\NameConverter\NameConverterInterface; -use Symfony\Component\Serializer\Tests\Fixtures\OtherSerializedNameDummy; use Symfony\Component\Serializer\Tests\Fixtures\Annotations\SerializedNameDummy; +use Symfony\Component\Serializer\Tests\Fixtures\OtherSerializedNameDummy; /** * @author Fabien Bourigault diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/AbstractNormalizerTest.php b/src/Symfony/Component/Serializer/Tests/Normalizer/AbstractNormalizerTest.php index 3aa4d1c63d..1985911ea6 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/AbstractNormalizerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/AbstractNormalizerTest.php @@ -14,8 +14,8 @@ use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; use Symfony\Component\Serializer\Normalizer\PropertyNormalizer; use Symfony\Component\Serializer\Serializer; use Symfony\Component\Serializer\Tests\Fixtures\AbstractNormalizerDummy; -use Symfony\Component\Serializer\Tests\Fixtures\Dummy; use Symfony\Component\Serializer\Tests\Fixtures\Annotations\IgnoreDummy; +use Symfony\Component\Serializer\Tests\Fixtures\Dummy; use Symfony\Component\Serializer\Tests\Fixtures\NullableConstructorArgumentDummy; use Symfony\Component\Serializer\Tests\Fixtures\StaticConstructorDummy; use Symfony\Component\Serializer\Tests\Fixtures\StaticConstructorNormalizer; diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php b/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php index b2efafc348..c16bf1ee1f 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php @@ -27,8 +27,8 @@ use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Symfony\Component\Serializer\Serializer; use Symfony\Component\Serializer\SerializerInterface; -use Symfony\Component\Serializer\Tests\Fixtures\CircularReferenceDummy; use Symfony\Component\Serializer\Tests\Fixtures\Annotations\GroupDummy; +use Symfony\Component\Serializer\Tests\Fixtures\CircularReferenceDummy; use Symfony\Component\Serializer\Tests\Fixtures\SiblingHolder; use Symfony\Component\Serializer\Tests\Normalizer\Features\CallbacksTestTrait; use Symfony\Component\Serializer\Tests\Normalizer\Features\CircularReferenceTestTrait; diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/PropertyNormalizerTest.php b/src/Symfony/Component/Serializer/Tests/Normalizer/PropertyNormalizerTest.php index 67989d200e..663eacc3ef 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/PropertyNormalizerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/PropertyNormalizerTest.php @@ -25,9 +25,9 @@ use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\PropertyNormalizer; use Symfony\Component\Serializer\Serializer; use Symfony\Component\Serializer\SerializerInterface; -use Symfony\Component\Serializer\Tests\Fixtures\Dummy; use Symfony\Component\Serializer\Tests\Fixtures\Annotations\GroupDummy; use Symfony\Component\Serializer\Tests\Fixtures\Annotations\GroupDummyChild; +use Symfony\Component\Serializer\Tests\Fixtures\Dummy; use Symfony\Component\Serializer\Tests\Fixtures\Php74Dummy; use Symfony\Component\Serializer\Tests\Fixtures\PropertyCircularReferenceDummy; use Symfony\Component\Serializer\Tests\Fixtures\PropertySiblingHolder; diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/UidNormalizerTest.php b/src/Symfony/Component/Serializer/Tests/Normalizer/UidNormalizerTest.php index 172c328a5e..44a7217e0a 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/UidNormalizerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/UidNormalizerTest.php @@ -3,7 +3,6 @@ namespace Symfony\Component\Serializer\Tests\Normalizer; use PHPUnit\Framework\TestCase; -use Symfony\Component\Serializer\Exception\InvalidArgumentException; use Symfony\Component\Serializer\Normalizer\UidNormalizer; use Symfony\Component\Uid\AbstractUid; use Symfony\Component\Uid\Ulid; diff --git a/src/Symfony/Component/Translation/Tests/PseudoLocalizationTranslatorTest.php b/src/Symfony/Component/Translation/Tests/PseudoLocalizationTranslatorTest.php index b63e3da2db..895586fde7 100644 --- a/src/Symfony/Component/Translation/Tests/PseudoLocalizationTranslatorTest.php +++ b/src/Symfony/Component/Translation/Tests/PseudoLocalizationTranslatorTest.php @@ -20,7 +20,7 @@ final class PseudoLocalizationTranslatorTest extends TestCase /** * @dataProvider provideTrans */ - public function testTrans(string $expected, string $input, array $options = []): void + public function testTrans(string $expected, string $input, array $options = []) { mt_srand(987); $this->assertSame($expected, (new PseudoLocalizationTranslator(new IdentityTranslator(), $options))->trans($input)); @@ -50,7 +50,7 @@ final class PseudoLocalizationTranslatorTest extends TestCase /** * @dataProvider provideInvalidExpansionFactor */ - public function testInvalidExpansionFactor(float $expansionFactor): void + public function testInvalidExpansionFactor(float $expansionFactor) { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('The expansion factor must be greater than or equal to 1.'); diff --git a/src/Symfony/Component/Validator/Constraints/Regex.php b/src/Symfony/Component/Validator/Constraints/Regex.php index fbe2485b43..35a1806039 100644 --- a/src/Symfony/Component/Validator/Constraints/Regex.php +++ b/src/Symfony/Component/Validator/Constraints/Regex.php @@ -38,7 +38,7 @@ class Regex extends Constraint /** * {@inheritdoc} * - * @param string|array $pattern The pattern to evaluate or an array of options. + * @param string|array $pattern The pattern to evaluate or an array of options */ public function __construct( $pattern, diff --git a/src/Symfony/Component/Validator/Constraints/Timezone.php b/src/Symfony/Component/Validator/Constraints/Timezone.php index bdc3ee582e..409fbc1d12 100644 --- a/src/Symfony/Component/Validator/Constraints/Timezone.php +++ b/src/Symfony/Component/Validator/Constraints/Timezone.php @@ -44,7 +44,7 @@ class Timezone extends Constraint /** * {@inheritdoc} * - * @param int|array|null $zone A combination of {@see \DateTimeZone} class constants or a set of options. + * @param int|array|null $zone A combination of {@see \DateTimeZone} class constants or a set of options */ public function __construct( $zone = null, diff --git a/src/Symfony/Component/Validator/Constraints/Type.php b/src/Symfony/Component/Validator/Constraints/Type.php index 95e1c61e02..220c2191a3 100644 --- a/src/Symfony/Component/Validator/Constraints/Type.php +++ b/src/Symfony/Component/Validator/Constraints/Type.php @@ -34,7 +34,7 @@ class Type extends Constraint /** * {@inheritdoc} * - * @param string|array $type One ore multiple types to validate against or a set of options. + * @param string|array $type One ore multiple types to validate against or a set of options */ public function __construct($type, string $message = null, array $groups = null, $payload = null, array $options = []) { diff --git a/src/Symfony/Component/Validator/Tests/Command/DebugCommandTest.php b/src/Symfony/Component/Validator/Tests/Command/DebugCommandTest.php index 676b28d93f..0f2b7b17f6 100644 --- a/src/Symfony/Component/Validator/Tests/Command/DebugCommandTest.php +++ b/src/Symfony/Component/Validator/Tests/Command/DebugCommandTest.php @@ -26,7 +26,7 @@ use Symfony\Component\Validator\Tests\Dummy\DummyClassOne; */ class DebugCommandTest extends TestCase { - public function testOutputWithClassArgument(): void + public function testOutputWithClassArgument() { $validator = $this->createMock(MetadataFactoryInterface::class); $classMetadata = $this->createMock(ClassMetadataInterface::class); @@ -90,7 +90,7 @@ TXT ); } - public function testOutputWithPathArgument(): void + public function testOutputWithPathArgument() { $validator = $this->createMock(MetadataFactoryInterface::class); $classMetadata = $this->createMock(ClassMetadataInterface::class); @@ -171,7 +171,7 @@ TXT ); } - public function testOutputWithInvalidClassArgument(): void + public function testOutputWithInvalidClassArgument() { $validator = $this->createMock(MetadataFactoryInterface::class); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LanguageValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LanguageValidatorTest.php index c0e62f7b23..d17d597e72 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/LanguageValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/LanguageValidatorTest.php @@ -161,7 +161,6 @@ class LanguageValidatorTest extends ConstraintValidatorTestCase eval('return new \Symfony\Component\Validator\Constraints\Language(alpha3: true, message: "myMessage");') ); - $this->buildViolation('myMessage') ->setParameter('{{ value }}', '"DE"') ->setCode(Language::NO_SUCH_LANGUAGE_ERROR) diff --git a/src/Symfony/Component/Validator/Tests/Fixtures/ConstraintChoiceWithPreset.php b/src/Symfony/Component/Validator/Tests/Fixtures/ConstraintChoiceWithPreset.php index 9e0cc37e23..e4154e8c8d 100644 --- a/src/Symfony/Component/Validator/Tests/Fixtures/ConstraintChoiceWithPreset.php +++ b/src/Symfony/Component/Validator/Tests/Fixtures/ConstraintChoiceWithPreset.php @@ -17,10 +17,11 @@ class ConstraintChoiceWithPreset extends Choice { public $type; - public function __construct(string $type) { + public function __construct(string $type) + { parent::__construct($type); - if ($this->type === 'A') { + if ('A' === $this->type) { $this->choices = ['A', 'B', 'C']; } else { $this->choices = ['D', 'E', 'F'];