From 50598af51f2298666f12ce4a8114bd69de6287c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Sun, 11 Feb 2024 10:29:47 +0100 Subject: [PATCH] Fixed CS --- .php-cs-fixer.php | 1 + .../Symfony/DependencyInjection/JoliTypoExtension.php | 3 --- src/JoliTypo/Fixer.php | 8 ++++---- src/JoliTypo/Fixer/Numeric.php | 2 -- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 49cbe4b..0956555 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -36,6 +36,7 @@ 'concat_space' => ['spacing' => 'one'], 'ordered_class_elements' => true, // Symfony(PSR12) override the default value, but we don't want 'blank_line_before_statement' => true, // Symfony(PSR12) override the default value, but we don't want + 'nullable_type_declaration' => true, // Same as symfony ]) ->setFinder($finder) ; diff --git a/src/JoliTypo/Bridge/Symfony/DependencyInjection/JoliTypoExtension.php b/src/JoliTypo/Bridge/Symfony/DependencyInjection/JoliTypoExtension.php index 4d1870e..5d6b749 100644 --- a/src/JoliTypo/Bridge/Symfony/DependencyInjection/JoliTypoExtension.php +++ b/src/JoliTypo/Bridge/Symfony/DependencyInjection/JoliTypoExtension.php @@ -18,9 +18,6 @@ class JoliTypoExtension extends Extension { - /** - * {@inheritdoc} - */ public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); diff --git a/src/JoliTypo/Fixer.php b/src/JoliTypo/Fixer.php index 7dd34ac..583113a 100644 --- a/src/JoliTypo/Fixer.php +++ b/src/JoliTypo/Fixer.php @@ -190,7 +190,7 @@ private function compileRules(array $rules): void foreach ($rules as $rule) { if (\is_object($rule)) { $fixer = $rule; - $className = \get_class($rule); + $className = $rule::class; } else { $className = class_exists($rule) ? $rule : (class_exists( 'JoliTypo\\Fixer\\' . $rule @@ -275,7 +275,7 @@ private function doFix(\DOMText $childNode, \DOMNode $node, \DOMDocument $dom): } /** - * @throws Exception\InvalidMarkupException + * @throws InvalidMarkupException */ private function loadDOMDocument($content): \DOMDocument { @@ -311,8 +311,8 @@ private function fixContentEncoding($content): string { if (!empty($content)) { // Little hack to force UTF-8 - if (false === strpos($content, '' : ''; diff --git a/src/JoliTypo/Fixer/Numeric.php b/src/JoliTypo/Fixer/Numeric.php index f1cd107..69e355b 100644 --- a/src/JoliTypo/Fixer/Numeric.php +++ b/src/JoliTypo/Fixer/Numeric.php @@ -10,8 +10,6 @@ namespace JoliTypo\Fixer; /** - * {@inheritdoc} - * * @deprecated Numeric should not be used (reserved keyword in PHP7) */ class Numeric extends Unit