Skip to content

Commit 73f61fd

Browse files
committed
docs
1 parent 9b3e819 commit 73f61fd

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff 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\PHPStanRules\Rules\Symfony\NoConstructorAndRequiredTogetherRule
1187+
```
1188+
1189+
<br>
1190+
11801191
### NoGetDoctrineInControllerRule
11811192

11821193
Prevents using `$this->getDoctrine()` in controllers, to promote dependency injection.

src/Rules/Symfony/NoConstructorAndRequiredTogetherRule.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
namespace Symplify\PHPStanRules\Rules\Symfony;
66

7-
use PhpParser\Node;
8-
use PHPStan\Analyser\Scope;
9-
use PHPStan\Rules\Rule;
107
use PhpParser\Comment\Doc;
8+
use PhpParser\Node;
119
use PhpParser\Node\Stmt\Class_;
10+
use PHPStan\Analyser\Scope;
1211
use PHPStan\Rules\IdentifierRuleError;
12+
use PHPStan\Rules\Rule;
1313
use PHPStan\Rules\RuleErrorBuilder;
1414
use Symplify\PHPStanRules\Enum\MethodName;
1515
use Symplify\PHPStanRules\Enum\SymfonyRuleIdentifier;

0 commit comments

Comments
 (0)