diff --git a/composer.json b/composer.json index 494dfda2..eaf1be1c 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,7 @@ "phpstan/phpstan": "*", "phpunit/phpunit": "^9.6", "povils/phpmnd": "^3.3", - "rector/rector": "1.0.5", + "rector/rector": "1.2.10", "roave/security-advisories": "dev-latest", "rregeer/phpunit-coverage-check": "^0.3.1", "spaze/phpstan-disallowed-calls": "^3.0", diff --git a/composer.lock b/composer.lock index b98ccba6..5d3dab82 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e8f31617c04af645443c1114ccbed577", + "content-hash": "9a0593bf794aa116e2d028003b2eea17", "packages": [ { "name": "deeplcom/deepl-php", @@ -4772,21 +4772,21 @@ }, { "name": "rector/rector", - "version": "1.0.5", + "version": "1.2.10", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "73eb63e4f9011dba6b7c66c3262543014e352f34" + "reference": "40f9cf38c05296bd32f444121336a521a293fa61" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/73eb63e4f9011dba6b7c66c3262543014e352f34", - "reference": "73eb63e4f9011dba6b7c66c3262543014e352f34", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/40f9cf38c05296bd32f444121336a521a293fa61", + "reference": "40f9cf38c05296bd32f444121336a521a293fa61", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.57" + "phpstan/phpstan": "^1.12.5" }, "conflict": { "rector/rector-doctrine": "*", @@ -4819,7 +4819,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/1.0.5" + "source": "https://github.com/rectorphp/rector/tree/1.2.10" }, "funding": [ { @@ -4827,7 +4827,7 @@ "type": "github" } ], - "time": "2024-05-10T05:31:15+00:00" + "time": "2024-11-08T13:59:10+00:00" }, { "name": "roave/security-advisories", diff --git a/src/Bundles/Scanner/MJML/MjmlScanner.php b/src/Bundles/Scanner/MJML/MjmlScanner.php index 5f129b92..fb44aa7f 100644 --- a/src/Bundles/Scanner/MJML/MjmlScanner.php +++ b/src/Bundles/Scanner/MJML/MjmlScanner.php @@ -41,6 +41,6 @@ public function findKey(string $key, string $content): bool preg_match($pattern, $content, $matches); - return (!empty($matches)); + return ($matches !== []); } } diff --git a/src/Bundles/Scanner/TWIG/TwigScanner.php b/src/Bundles/Scanner/TWIG/TwigScanner.php index 94032842..ebf1c1d7 100644 --- a/src/Bundles/Scanner/TWIG/TwigScanner.php +++ b/src/Bundles/Scanner/TWIG/TwigScanner.php @@ -39,6 +39,6 @@ public function findKey(string $key, string $content): bool preg_match($pattern, $content, $matches); - return (!empty($matches)); + return ($matches !== []); } } diff --git a/src/Bundles/Spelling/OpenAI/OpenAISpellChecker.php b/src/Bundles/Spelling/OpenAI/OpenAISpellChecker.php index 352b7d37..d987055e 100644 --- a/src/Bundles/Spelling/OpenAI/OpenAISpellChecker.php +++ b/src/Bundles/Spelling/OpenAI/OpenAISpellChecker.php @@ -117,7 +117,7 @@ public function validate(Text $text, string $locale): SpellingValidationResult /** * @param Text $text * @param string $locale - * @throws \Exception + * @throws Exception * @return string */ public function fixSpelling(Text $text, string $locale): string diff --git a/src/Bundles/Storage/Shopware6/Config/FlowActionsXml.php b/src/Bundles/Storage/Shopware6/Config/FlowActionsXml.php index cf492913..a48303ac 100644 --- a/src/Bundles/Storage/Shopware6/Config/FlowActionsXml.php +++ b/src/Bundles/Storage/Shopware6/Config/FlowActionsXml.php @@ -279,7 +279,7 @@ public function getFlowActionConfigOptions(string $configName, string $actionNam { $config = $this->getFlowActionConfig($configName, $actionName, $xpath); - /** @var \DOMElement[] $nodes */ + /** @var DOMElement[] $nodes */ $nodes = $xpath->query('//options/*', $config); return $nodes; diff --git a/src/Bundles/Storage/Shopware6/Repository/EntityRepository.php b/src/Bundles/Storage/Shopware6/Repository/EntityRepository.php index 08866a9f..74dcc298 100644 --- a/src/Bundles/Storage/Shopware6/Repository/EntityRepository.php +++ b/src/Bundles/Storage/Shopware6/Repository/EntityRepository.php @@ -10,13 +10,13 @@ class EntityRepository use BinaryTrait; /** - * @var \PDO + * @var PDO */ private $pdo; /** - * @param \PDO $pdo + * @param PDO $pdo */ public function __construct(PDO $pdo) { diff --git a/src/Bundles/Storage/Shopware6/Repository/EntityTranslationRepository.php b/src/Bundles/Storage/Shopware6/Repository/EntityTranslationRepository.php index 926ce0a4..1e4576ac 100644 --- a/src/Bundles/Storage/Shopware6/Repository/EntityTranslationRepository.php +++ b/src/Bundles/Storage/Shopware6/Repository/EntityTranslationRepository.php @@ -11,13 +11,13 @@ class EntityTranslationRepository use BinaryTrait; /** - * @var \PDO + * @var PDO */ private $pdo; /** - * @param \PDO $pdo + * @param PDO $pdo */ public function __construct(PDO $pdo) { diff --git a/src/Bundles/Storage/Shopware6/Repository/LanguageRepository.php b/src/Bundles/Storage/Shopware6/Repository/LanguageRepository.php index 8d7caf44..ade4ade4 100644 --- a/src/Bundles/Storage/Shopware6/Repository/LanguageRepository.php +++ b/src/Bundles/Storage/Shopware6/Repository/LanguageRepository.php @@ -11,13 +11,13 @@ class LanguageRepository use BinaryTrait; /** - * @var \PDO + * @var PDO */ private $pdo; /** - * @param \PDO $pdo + * @param PDO $pdo */ public function __construct(PDO $pdo) { diff --git a/src/Bundles/Storage/Shopware6/Repository/SnippetRepository.php b/src/Bundles/Storage/Shopware6/Repository/SnippetRepository.php index cc288723..f43d6421 100644 --- a/src/Bundles/Storage/Shopware6/Repository/SnippetRepository.php +++ b/src/Bundles/Storage/Shopware6/Repository/SnippetRepository.php @@ -16,13 +16,13 @@ class SnippetRepository use BinaryTrait; /** - * @var \PDO + * @var PDO */ private $pdo; /** - * @param \PDO $pdo + * @param PDO $pdo */ public function __construct(PDO $pdo) { diff --git a/src/Components/Configuration/Services/RulesLoader.php b/src/Components/Configuration/Services/RulesLoader.php index 6f734ca3..cd37273f 100644 --- a/src/Components/Configuration/Services/RulesLoader.php +++ b/src/Components/Configuration/Services/RulesLoader.php @@ -49,7 +49,7 @@ public function loadRules(SimpleXMLElement $rulesNode): array } } - if ($duplicateContent !== null && $duplicateContent->children() !== null) { + if ($duplicateContent !== null && $duplicateContent->children() instanceof SimpleXMLElement) { $foundLocales = []; /** @var SimpleXMLElement $localeNode */ foreach ($duplicateContent->children() as $localeNode) { @@ -60,7 +60,7 @@ public function loadRules(SimpleXMLElement $rulesNode): array $rules[] = new Rule(Rules::DUPLICATE_CONTENT, $foundLocales); } - if ($emptyContent !== null && $emptyContent->children() !== null) { + if ($emptyContent !== null && $emptyContent->children() instanceof SimpleXMLElement) { $foundKeys = []; foreach ($rulesNode->emptyContent->children() as $keyNode) { $keyName = $this->getAttribute('name', $keyNode)->getValue(); diff --git a/tests/phpunit/Bundles/Translator/DeepL/DeepLTranslatorTest.php b/tests/phpunit/Bundles/Translator/DeepL/DeepLTranslatorTest.php index e8f16c02..cfb44f76 100644 --- a/tests/phpunit/Bundles/Translator/DeepL/DeepLTranslatorTest.php +++ b/tests/phpunit/Bundles/Translator/DeepL/DeepLTranslatorTest.php @@ -37,7 +37,7 @@ public function testGetOptions(): void } /** - * @throws \Exception + * @throws Exception * @return void */ public function testSetOptionsWithMissingKeyThrowsException(): void @@ -53,7 +53,7 @@ public function testSetOptionsWithMissingKeyThrowsException(): void } /** - * @throws \Exception + * @throws Exception * @return void */ public function testSetOptions(): void diff --git a/tests/phpunit/Bundles/Translator/GoogleCloud/GoogleCloudTranslatorTest.php b/tests/phpunit/Bundles/Translator/GoogleCloud/GoogleCloudTranslatorTest.php index 67baafd4..f0007e2b 100644 --- a/tests/phpunit/Bundles/Translator/GoogleCloud/GoogleCloudTranslatorTest.php +++ b/tests/phpunit/Bundles/Translator/GoogleCloud/GoogleCloudTranslatorTest.php @@ -34,7 +34,7 @@ public function testGetOptions(): void } /** - * @throws \Exception + * @throws Exception * @return void */ public function testSetOptions(): void @@ -50,7 +50,7 @@ public function testSetOptions(): void } /** - * @throws \Exception + * @throws Exception * @return void */ public function testSetOptionsWithMissingKeyThrowsException(): void diff --git a/tests/phpunit/Bundles/Translator/OpenAI/OpenAITranslatorTest.php b/tests/phpunit/Bundles/Translator/OpenAI/OpenAITranslatorTest.php index 17c68f8d..8581e4f4 100644 --- a/tests/phpunit/Bundles/Translator/OpenAI/OpenAITranslatorTest.php +++ b/tests/phpunit/Bundles/Translator/OpenAI/OpenAITranslatorTest.php @@ -33,7 +33,7 @@ public function testGetOptions(): void } /** - * @throws \Exception + * @throws Exception * @return void */ public function testSetOptionsWithMissingKeyThrowsException(): void @@ -49,7 +49,7 @@ public function testSetOptionsWithMissingKeyThrowsException(): void } /** - * @throws \Exception + * @throws Exception * @return void */ public function testSetOptions(): void