From a2f8efa9cd37999a9cab2e1d874525a4fe54c4f7 Mon Sep 17 00:00:00 2001 From: Yanick Witschi Date: Mon, 29 Jun 2026 09:10:15 +0200 Subject: [PATCH] Ensure partial usage of Symfony validator assertions and Doctrine ORM attributes --- composer.json | 2 +- config/contao.php | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index cdf4eeb..d7219c5 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "require": { "php": "^8.1", "kubawerlos/php-cs-fixer-custom-fixers": "^3.14", - "slevomat/coding-standard": "^8.0", + "slevomat/coding-standard": "^8.30", "symplify/easy-coding-standard": "^13.0" }, "require-dev": { diff --git a/config/contao.php b/config/contao.php index ddf87b0..11e6647 100644 --- a/config/contao.php +++ b/config/contao.php @@ -186,7 +186,18 @@ ->withConfiguredRule(PhpdocTypesFixer::class, ['groups' => ['simple', 'meta']]) ->withConfiguredRule(PhpUnitTestCaseStaticMethodCallsFixer::class, ['call_type' => 'this']) ->withConfiguredRule(RandomApiMigrationFixer::class, ['replacements' => ['mt_rand' => 'random_int', 'rand' => 'random_int']]) - ->withConfiguredRule(ReferenceUsedNamesOnlySniff::class, ['searchAnnotations' => true, 'allowFullyQualifiedNameForCollidingClasses' => true, 'allowFullyQualifiedGlobalClasses' => true, 'allowFullyQualifiedGlobalFunctions' => true, 'allowFullyQualifiedGlobalConstants' => true, 'allowPartialUses' => false]) + ->withConfiguredRule(ReferenceUsedNamesOnlySniff::class, [ + 'searchAnnotations' => true, + 'allowFullyQualifiedNameForCollidingClasses' => true, + 'allowFullyQualifiedGlobalClasses' => true, + 'allowFullyQualifiedGlobalFunctions' => true, + 'allowFullyQualifiedGlobalConstants' => true, + 'allowPartialUses' => false, + 'namespacesRequiredToUsePartially' => [ + 'Doctrine\ORM\Mapping as ORM', + 'Symfony\Component\Validator\Constraints as Assert', + ], + ]) ->withConfiguredRule(StringImplicitBackslashesFixer::class, ['single_quoted' => 'ignore', 'double_quoted' => 'escape', 'heredoc' => 'escape']) ->withConfiguredRule(TrailingCommaInMultilineFixer::class, ['elements' => ['arrays', 'arguments', 'match', 'parameters'], 'after_heredoc' => true]) ->withConfiguredRule(UnusedUsesSniff::class, ['searchAnnotations' => true])