From 4da36d2c4a46aa6270bd9c4875f6fac1c7c3af90 Mon Sep 17 00:00:00 2001 From: Luka Dschaak Date: Tue, 6 Aug 2024 15:44:35 +0200 Subject: [PATCH] [update] php cs fixer to 3.60 (#76) --- composer.json | 2 +- src/Converter/StrategicConverter.php | 2 +- src/DependencyInjection/NeustaConverterExtension.php | 2 +- src/Exception/PopulationException.php | 2 +- src/Target/GenericTargetFactory.php | 6 +++--- tests/DependencyInjection/NeustaConverterExtensionTest.php | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 4de75da..f7e4811 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ }, "require-dev": { "ergebnis/composer-normalize": "^2.42", - "friendsofphp/php-cs-fixer": "^3.11", + "friendsofphp/php-cs-fixer": "^3.60", "jangregor/phpstan-prophecy": "^1.0", "matthiasnoback/symfony-dependency-injection-test": "^5.1", "nyholm/symfony-bundle-test": "^3.0", diff --git a/src/Converter/StrategicConverter.php b/src/Converter/StrategicConverter.php index 09e0123..470b9f1 100644 --- a/src/Converter/StrategicConverter.php +++ b/src/Converter/StrategicConverter.php @@ -39,6 +39,6 @@ public function convert(object $source, ?object $ctx = null): object if (\array_key_exists($selectedConverterKey, $this->converters)) { return $this->converters[$selectedConverterKey]->convert($source, $ctx); } - throw new ConverterException(sprintf('No converter found for key <%s>', $selectedConverterKey)); + throw new ConverterException(\sprintf('No converter found for key <%s>', $selectedConverterKey)); } } diff --git a/src/DependencyInjection/NeustaConverterExtension.php b/src/DependencyInjection/NeustaConverterExtension.php index 767ebf6..457c65a 100644 --- a/src/DependencyInjection/NeustaConverterExtension.php +++ b/src/DependencyInjection/NeustaConverterExtension.php @@ -113,7 +113,7 @@ private function registerPopulatorConfiguration(string $id, array $config, Conta '$sourceArrayItemPropertyName' => $sourceProperty['source_array_item'] ?? null, '$accessor' => new Reference('property_accessor'), ], - default => throw new InvalidConfigurationException(sprintf('The populator "%s" is not supported.', $config['populator'])), + default => throw new InvalidConfigurationException(\sprintf('The populator "%s" is not supported.', $config['populator'])), }); } diff --git a/src/Exception/PopulationException.php b/src/Exception/PopulationException.php index 95d61ee..0981c75 100644 --- a/src/Exception/PopulationException.php +++ b/src/Exception/PopulationException.php @@ -9,7 +9,7 @@ class PopulationException extends \Exception public function __construct(string $sourcePropertyName, string $targetPropertyName, \Throwable $previous) { parent::__construct( - sprintf('Population Exception (%s -> %s): %s', + \sprintf('Population Exception (%s -> %s): %s', $sourcePropertyName, $targetPropertyName, $previous->getMessage(), diff --git a/src/Target/GenericTargetFactory.php b/src/Target/GenericTargetFactory.php index ea0d5bb..95ae26a 100644 --- a/src/Target/GenericTargetFactory.php +++ b/src/Target/GenericTargetFactory.php @@ -27,11 +27,11 @@ public function __construct(string $type) $this->type = new \ReflectionClass($type); if (!$this->type->isInstantiable()) { - throw new \InvalidArgumentException(sprintf('Target class "%s" is not instantiable.', $type)); + throw new \InvalidArgumentException(\sprintf('Target class "%s" is not instantiable.', $type)); } if ($this->type->getConstructor()?->getNumberOfRequiredParameters()) { - throw new \InvalidArgumentException(sprintf('Target class "%s" has required constructor parameters.', $type)); + throw new \InvalidArgumentException(\sprintf('Target class "%s" has required constructor parameters.', $type)); } } @@ -43,7 +43,7 @@ public function create(?object $ctx = null): object try { return $this->type->newInstance(); } catch (\ReflectionException $e) { - throw new \LogicException(sprintf('Cannot create new instance of "%s" because: %s', $this->type->getName(), $e->getMessage()), 0, $e); + throw new \LogicException(\sprintf('Cannot create new instance of "%s" because: %s', $this->type->getName(), $e->getMessage()), 0, $e); } } } diff --git a/tests/DependencyInjection/NeustaConverterExtensionTest.php b/tests/DependencyInjection/NeustaConverterExtensionTest.php index ff6c25b..9b4b9ed 100644 --- a/tests/DependencyInjection/NeustaConverterExtensionTest.php +++ b/tests/DependencyInjection/NeustaConverterExtensionTest.php @@ -440,7 +440,7 @@ protected function assertContainerBuilderHasPublicService(string $serviceId, ?st $this->assertContainerBuilderHasService($serviceId, $expectedClass); $this->assertTrue( $this->container->getDefinition('foobar')->isPublic(), - sprintf('service definition "%s" is "public"', $serviceId), + \sprintf('service definition "%s" is "public"', $serviceId), ); } }