diff --git a/src/Symfony/Bridge/Monolog/Handler/FingersCrossed/HttpCodeActivationStrategy.php b/src/Symfony/Bridge/Monolog/Handler/FingersCrossed/HttpCodeActivationStrategy.php index cdda14a386..84f61ce9bf 100644 --- a/src/Symfony/Bridge/Monolog/Handler/FingersCrossed/HttpCodeActivationStrategy.php +++ b/src/Symfony/Bridge/Monolog/Handler/FingersCrossed/HttpCodeActivationStrategy.php @@ -32,10 +32,10 @@ class HttpCodeActivationStrategy extends ErrorLevelActivationStrategy { foreach ($exclusions as $exclusion) { if (!\array_key_exists('code', $exclusion)) { - throw new \LogicException(sprintf('An exclusion must have a "code" key.')); + throw new \LogicException('An exclusion must have a "code" key.'); } if (!\array_key_exists('urls', $exclusion)) { - throw new \LogicException(sprintf('An exclusion must have a "urls" key.')); + throw new \LogicException('An exclusion must have a "urls" key.'); } } diff --git a/src/Symfony/Component/Config/Definition/Processor.php b/src/Symfony/Component/Config/Definition/Processor.php index a878b90557..e7b364864d 100644 --- a/src/Symfony/Component/Config/Definition/Processor.php +++ b/src/Symfony/Component/Config/Definition/Processor.php @@ -86,10 +86,10 @@ class Processor if (isset($config[$key])) { if (\is_string($config[$key]) || !\is_int(key($config[$key]))) { // only one - return [$config[$key]]; + return [$config[$key]]; } - return $config[$key]; + return $config[$key]; } return []; diff --git a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php index 3da6d790a5..98ac9345e8 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php @@ -491,7 +491,7 @@ class XmlFileLoader extends FileLoader break; case 'expression': if (!class_exists(Expression::class)) { - throw new \LogicException(sprintf('The type="expression" attribute cannot be used without the ExpressionLanguage component. Try running "composer require symfony/expression-language".')); + throw new \LogicException('The type="expression" attribute cannot be used without the ExpressionLanguage component. Try running "composer require symfony/expression-language".'); } $arguments[$key] = new Expression($arg->nodeValue); diff --git a/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php index 0be733e9ef..96c0514307 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php @@ -813,7 +813,7 @@ class YamlFileLoader extends FileLoader } } elseif (\is_string($value) && 0 === strpos($value, '@=')) { if (!class_exists(Expression::class)) { - throw new \LogicException(sprintf('The "@=" expression syntax cannot be used without the ExpressionLanguage component. Try running "composer require symfony/expression-language".')); + throw new \LogicException('The "@=" expression syntax cannot be used without the ExpressionLanguage component. Try running "composer require symfony/expression-language".'); } return new Expression(substr($value, 2)); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/CheckTypeDeclarationsPass/Foo.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/CheckTypeDeclarationsPass/Foo.php index 34998824c5..be92ec5c29 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/CheckTypeDeclarationsPass/Foo.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/CheckTypeDeclarationsPass/Foo.php @@ -16,7 +16,7 @@ class Foo public static function createCallable(): callable { - return function() {}; + return function () {}; } public static function createArray(): array diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/DeprecatedClass.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/DeprecatedClass.php index 33f37a0304..691d52ffea 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/DeprecatedClass.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/DeprecatedClass.php @@ -11,7 +11,7 @@ namespace Symfony\Component\DependencyInjection\Tests\Fixtures; -@trigger_error('deprecated', E_USER_DEPRECATED); +@trigger_error('deprecated', \E_USER_DEPRECATED); class DeprecatedClass { diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/FactoryDummy.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/FactoryDummy.php index b7ceac7d8a..ad4d62ad0e 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/FactoryDummy.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/FactoryDummy.php @@ -13,7 +13,7 @@ namespace Symfony\Component\DependencyInjection\Tests\Fixtures; class FactoryDummy extends FactoryParent { - public static function createFactory(): FactoryDummy + public static function createFactory(): self { } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/MultipleArgumentsOptionalScalarNotReallyOptional.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/MultipleArgumentsOptionalScalarNotReallyOptional.php index dcaaacc1f4..754470a413 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/MultipleArgumentsOptionalScalarNotReallyOptional.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/MultipleArgumentsOptionalScalarNotReallyOptional.php @@ -11,4 +11,3 @@ class MultipleArgumentsOptionalScalarNotReallyOptional { } } - diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes.php index df5c1c42b2..870f8aed0b 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes.php @@ -4,7 +4,7 @@ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use Psr\Log\LoggerInterface; -if (PHP_VERSION_ID >= 80000) { +if (\PHP_VERSION_ID >= 80000) { require __DIR__.'/uniontype_classes.php'; } @@ -275,6 +275,7 @@ class Wither /** * @required + * * @return static */ public function withFoo1(Foo $foo) @@ -284,6 +285,7 @@ class Wither /** * @required + * * @return static */ public function withFoo2(Foo $foo) diff --git a/src/Symfony/Component/DomCrawler/Tests/Html5ParserCrawlerTest.php b/src/Symfony/Component/DomCrawler/Tests/Html5ParserCrawlerTest.php index 585c3c84eb..806bc2e181 100644 --- a/src/Symfony/Component/DomCrawler/Tests/Html5ParserCrawlerTest.php +++ b/src/Symfony/Component/DomCrawler/Tests/Html5ParserCrawlerTest.php @@ -41,7 +41,7 @@ class Html5ParserCrawlerTest extends AbstractCrawlerTest } /** @dataProvider invalidHtml5Provider */ - public function testHtml5ParserWithInvalidHeadedContent(string $content): void + public function testHtml5ParserWithInvalidHeadedContent(string $content) { $this->skipTestIfHTML5LibraryNotAvailable(); diff --git a/src/Symfony/Component/ErrorHandler/Tests/Fixtures/FinalClasses.php b/src/Symfony/Component/ErrorHandler/Tests/Fixtures/FinalClasses.php index 936d791f5e..d56ccdce63 100644 --- a/src/Symfony/Component/ErrorHandler/Tests/Fixtures/FinalClasses.php +++ b/src/Symfony/Component/ErrorHandler/Tests/Fixtures/FinalClasses.php @@ -41,7 +41,6 @@ class FinalClass4 /** * @author John Doe * - * * @final multiline * comment */ diff --git a/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php b/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php index d2f1a4e096..f122754642 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php @@ -327,7 +327,7 @@ class TimeType extends AbstractType $resolver->setDeprecated('model_timezone', function (Options $options, $modelTimezone): string { if (null !== $modelTimezone && $options['view_timezone'] !== $modelTimezone && null === $options['reference_date']) { - return sprintf('Using different values for the "model_timezone" and "view_timezone" options without configuring a reference date is deprecated since Symfony 4.4.'); + return 'Using different values for the "model_timezone" and "view_timezone" options without configuring a reference date is deprecated since Symfony 4.4.'; } return ''; diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/StringToFloatTransformerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/StringToFloatTransformerTest.php index cbe65ae4c8..3de0383c07 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/StringToFloatTransformerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/StringToFloatTransformerTest.php @@ -70,7 +70,7 @@ class StringToFloatTransformerTest extends TestCase /** * @dataProvider provideReverseTransformations */ - public function testReverseTransform($from, $to, int $scale = null): void + public function testReverseTransform($from, $to, int $scale = null) { $transformer = new StringToFloatTransformer($scale); diff --git a/src/Symfony/Component/Ldap/Tests/LdapTestCase.php b/src/Symfony/Component/Ldap/Tests/LdapTestCase.php index 606065e491..dad9f03d0c 100644 --- a/src/Symfony/Component/Ldap/Tests/LdapTestCase.php +++ b/src/Symfony/Component/Ldap/Tests/LdapTestCase.php @@ -9,7 +9,7 @@ class LdapTestCase extends TestCase protected function getLdapConfig() { $h = @ldap_connect(getenv('LDAP_HOST'), getenv('LDAP_PORT')); - @ldap_set_option($h, LDAP_OPT_PROTOCOL_VERSION, 3); + @ldap_set_option($h, \LDAP_OPT_PROTOCOL_VERSION, 3); if (!$h || !@ldap_bind($h)) { $this->markTestSkipped('No server is listening on LDAP_HOST:LDAP_PORT'); diff --git a/src/Symfony/Component/Mailer/Test/TransportFactoryTestCase.php b/src/Symfony/Component/Mailer/Test/TransportFactoryTestCase.php index 255a0ade81..c16835b7e1 100644 --- a/src/Symfony/Component/Mailer/Test/TransportFactoryTestCase.php +++ b/src/Symfony/Component/Mailer/Test/TransportFactoryTestCase.php @@ -64,7 +64,7 @@ abstract class TransportFactoryTestCase extends TestCase /** * @dataProvider createProvider */ - public function testCreate(Dsn $dsn, TransportInterface $transport): void + public function testCreate(Dsn $dsn, TransportInterface $transport) { $factory = $this->getFactory(); @@ -77,7 +77,7 @@ abstract class TransportFactoryTestCase extends TestCase /** * @dataProvider unsupportedSchemeProvider */ - public function testUnsupportedSchemeException(Dsn $dsn, string $message = null): void + public function testUnsupportedSchemeException(Dsn $dsn, string $message = null) { $factory = $this->getFactory(); @@ -92,7 +92,7 @@ abstract class TransportFactoryTestCase extends TestCase /** * @dataProvider incompleteDsnProvider */ - public function testIncompleteDsnException(Dsn $dsn): void + public function testIncompleteDsnException(Dsn $dsn) { $factory = $this->getFactory(); diff --git a/src/Symfony/Component/Mailer/Tests/Transport/DsnTest.php b/src/Symfony/Component/Mailer/Tests/Transport/DsnTest.php index e0eb59e733..2816333ff3 100644 --- a/src/Symfony/Component/Mailer/Tests/Transport/DsnTest.php +++ b/src/Symfony/Component/Mailer/Tests/Transport/DsnTest.php @@ -38,7 +38,7 @@ class DsnTest extends TestCase /** * @dataProvider invalidDsnProvider */ - public function testInvalidDsn(string $dsn, string $exceptionMessage): void + public function testInvalidDsn(string $dsn, string $exceptionMessage) { $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage($exceptionMessage); diff --git a/src/Symfony/Component/Mailer/Tests/TransportTest.php b/src/Symfony/Component/Mailer/Tests/TransportTest.php index 66c5e440ce..690b0eed76 100644 --- a/src/Symfony/Component/Mailer/Tests/TransportTest.php +++ b/src/Symfony/Component/Mailer/Tests/TransportTest.php @@ -63,7 +63,7 @@ class TransportTest extends TestCase /** * @dataProvider fromDsnProvider */ - public function testFromDsn(string $dsn, TransportInterface $transport): void + public function testFromDsn(string $dsn, TransportInterface $transport) { $this->assertEquals($transport, Transport::fromDsn($dsn)); } @@ -79,7 +79,7 @@ class TransportTest extends TestCase /** * @dataProvider fromWrongStringProvider */ - public function testFromWrongString(string $dsn, string $error): void + public function testFromWrongString(string $dsn, string $error) { $transportFactory = new Transport([new DummyTransportFactory()]); @@ -116,7 +116,7 @@ class DummyTransport implements Transport\TransportInterface public function __toString(): string { - return sprintf('dummy://local'); + return 'dummy://local'; } } diff --git a/src/Symfony/Component/Messenger/RoutableMessageBus.php b/src/Symfony/Component/Messenger/RoutableMessageBus.php index a4a663589f..8b7bedf731 100644 --- a/src/Symfony/Component/Messenger/RoutableMessageBus.php +++ b/src/Symfony/Component/Messenger/RoutableMessageBus.php @@ -45,7 +45,7 @@ class RoutableMessageBus implements MessageBusInterface if (null === $busNameStamp) { if (null === $this->fallbackBus) { - throw new InvalidArgumentException(sprintf('Envelope is missing a BusNameStamp and no fallback message bus is configured on RoutableMessageBus.')); + throw new InvalidArgumentException('Envelope is missing a BusNameStamp and no fallback message bus is configured on RoutableMessageBus.'); } return $this->fallbackBus->dispatch($envelope, $stamps); diff --git a/src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/Fixtures/long_receiver.php b/src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/Fixtures/long_receiver.php index fc122b7390..adfe492306 100644 --- a/src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/Fixtures/long_receiver.php +++ b/src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/Fixtures/long_receiver.php @@ -40,7 +40,7 @@ $worker = new Worker(['the_receiver' => $receiver], new class() implements Messa public function dispatch($envelope, array $stamps = []): Envelope { echo 'Get envelope with message: '.get_class($envelope->getMessage())."\n"; - echo sprintf("with stamps: %s\n", json_encode(array_keys($envelope->all()), JSON_PRETTY_PRINT)); + echo sprintf("with stamps: %s\n", json_encode(array_keys($envelope->all()), \JSON_PRETTY_PRINT)); sleep(30); echo "Done.\n"; diff --git a/src/Symfony/Component/Messenger/Tests/Transport/Doctrine/ConnectionTest.php b/src/Symfony/Component/Messenger/Tests/Transport/Doctrine/ConnectionTest.php index ff87d9b512..59d8819a75 100644 --- a/src/Symfony/Component/Messenger/Tests/Transport/Doctrine/ConnectionTest.php +++ b/src/Symfony/Component/Messenger/Tests/Transport/Doctrine/ConnectionTest.php @@ -193,7 +193,7 @@ class ConnectionTest extends TestCase 'expectedAutoSetup' => true, ]; - yield 'test options array' => [ + yield 'test options array' => [ 'dsn' => 'doctrine://default', 'options' => [ 'table_name' => 'name_from_options', diff --git a/src/Symfony/Component/Mime/Test/Constraint/EmailAddressContains.php b/src/Symfony/Component/Mime/Test/Constraint/EmailAddressContains.php index c751c3d45f..827e141472 100644 --- a/src/Symfony/Component/Mime/Test/Constraint/EmailAddressContains.php +++ b/src/Symfony/Component/Mime/Test/Constraint/EmailAddressContains.php @@ -59,7 +59,7 @@ final class EmailAddressContains extends Constraint return false; } - throw new \LogicException(sprintf('Unable to test a message address on a non-address header.')); + throw new \LogicException('Unable to test a message address on a non-address header.'); } /** diff --git a/src/Symfony/Component/Validator/Tests/Fixtures/PropertyGetter.php b/src/Symfony/Component/Validator/Tests/Fixtures/PropertyGetter.php index e1e14bb007..2e9a7db295 100644 --- a/src/Symfony/Component/Validator/Tests/Fixtures/PropertyGetter.php +++ b/src/Symfony/Component/Validator/Tests/Fixtures/PropertyGetter.php @@ -5,7 +5,7 @@ namespace Symfony\Component\Validator\Tests\Fixtures; /** * This class has two paths to PropertyGetterInterface: * PropertyGetterInterface <- AbstractPropertyGetter <- PropertyGetter - * PropertyGetterInterface <- ChildGetterInterface <- PropertyGetter + * PropertyGetterInterface <- ChildGetterInterface <- PropertyGetter. */ class PropertyGetter extends AbstractPropertyGetter implements ChildGetterInterface { diff --git a/src/Symfony/Contracts/HttpClient/Test/Fixtures/web/index.php b/src/Symfony/Contracts/HttpClient/Test/Fixtures/web/index.php index 68406e69c4..30a7049758 100644 --- a/src/Symfony/Contracts/HttpClient/Test/Fixtures/web/index.php +++ b/src/Symfony/Contracts/HttpClient/Test/Fixtures/web/index.php @@ -29,7 +29,7 @@ foreach ($_SERVER as $k => $v) { } } -$json = json_encode($vars, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); +$json = json_encode($vars, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE); switch ($vars['REQUEST_URI']) { default: @@ -111,7 +111,7 @@ switch ($vars['REQUEST_URI']) { break; case '/post': - $output = json_encode($_POST + ['REQUEST_METHOD' => $vars['REQUEST_METHOD']], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); + $output = json_encode($_POST + ['REQUEST_METHOD' => $vars['REQUEST_METHOD']], \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE); header('Content-Type: application/json', true); header('Content-Length: '.strlen($output)); echo $output;