File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -1177,6 +1177,17 @@ final class SomeFixture extends AbstractFixture
11771177
11781178# # 3. Symfony-specific Rules
11791179
1180+ # ## NoConstructorAndRequiredTogetherRule
1181+
1182+ Constructor injection and `#[Required]` method should not be used together in single class. Pick one, to keep architecture clean.
1183+
1184+ ` ` ` yaml
1185+ rules:
1186+ - Symplify\P HPStanRules\R ules\S ymfony\N oConstructorAndRequiredTogetherRule
1187+ ` ` `
1188+
1189+ <br>
1190+
11801191# ## NoGetDoctrineInControllerRule
11811192
11821193Prevents using `$this->getDoctrine()` in controllers, to promote dependency injection.
Original file line number Diff line number Diff line change 44
55namespace Symplify \PHPStanRules \Rules \Symfony ;
66
7- use PhpParser \Node ;
8- use PHPStan \Analyser \Scope ;
9- use PHPStan \Rules \Rule ;
107use PhpParser \Comment \Doc ;
8+ use PhpParser \Node ;
119use PhpParser \Node \Stmt \Class_ ;
10+ use PHPStan \Analyser \Scope ;
1211use PHPStan \Rules \IdentifierRuleError ;
12+ use PHPStan \Rules \Rule ;
1313use PHPStan \Rules \RuleErrorBuilder ;
1414use Symplify \PHPStanRules \Enum \MethodName ;
1515use Symplify \PHPStanRules \Enum \SymfonyRuleIdentifier ;
You can’t perform that action at this time.
0 commit comments