Execution error on php v7.4 with excluded subcodebase containing php v8+ #6991
-
Support questionExecution of php-cs-fixer v3.14 with runtime php v7.4 on a codebase that may have some php v8+ code (attributes) My codebase is like this:
Even if I
Many thanks, |
Beta Was this translation helpful? Give feedback.
Answered by
kubawerlos
May 25, 2023
Replies: 2 comments 4 replies
-
Definitely, can you share the config? |
Beta Was this translation helpful? Give feedback.
1 reply
-
@kubawerlos here it is: <?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$config = new Config();
return $config
->setRiskyAllowed(true)
->setRules([
'@PSR1' => true,
'@PSR2' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'@DoctrineAnnotation' => true,
...
])
->setFinder(
Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->exclude([
'src/Company/Bundle/CartRequestBundle',
// same with this:
// `__DIR__ . '/src/Company/Bundle/CartRequestBundle',`
])
)
; |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As I suspected, classic mistake with
exclude
:(from https://symfony.com/doc/current/components/finder.html)