File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
rules/PHPUnit90/Rector/MethodCall Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 4646use Rector \PHPUnit \CodeQuality \Rector \MethodCall \UseSpecificWillMethodRector ;
4747use Rector \PHPUnit \CodeQuality \Rector \MethodCall \UseSpecificWithMethodRector ;
4848use Rector \PHPUnit \PHPUnit60 \Rector \MethodCall \GetMockBuilderGetMockToCreateMockRector ;
49+ use Rector \PHPUnit \PHPUnit90 \Rector \MethodCall \ReplaceAtMethodWithDesiredMatcherRector ;
4950
5051return static function (RectorConfig $ rectorConfig ): void {
5152 $ rectorConfig ->rules ([
119120 // prefer simple mocking
120121 GetMockBuilderGetMockToCreateMockRector::class,
121122 EntityDocumentCreateMockToDirectNewRector::class,
123+ ReplaceAtMethodWithDesiredMatcherRector::class,
122124 ]);
123125};
Original file line number Diff line number Diff line change 77use PhpParser \Node ;
88use PhpParser \Node \Arg ;
99use PhpParser \Node \Expr \MethodCall ;
10- use PhpParser \Node \Identifier ;
1110use PhpParser \Node \Scalar \Int_ ;
1211use Rector \PHPUnit \NodeAnalyzer \TestsNodeAnalyzer ;
1312use Rector \Rector \AbstractRector ;
@@ -21,8 +20,7 @@ final class ReplaceAtMethodWithDesiredMatcherRector extends AbstractRector
2120{
2221 public function __construct (
2322 private readonly TestsNodeAnalyzer $ testsNodeAnalyzer
24- )
25- {
23+ ) {
2624 }
2725
2826 public function getRuleDefinition (): RuleDefinition
@@ -60,11 +58,11 @@ public function getNodeTypes(): array
6058 */
6159 public function refactor (Node $ node ): null |MethodCall
6260 {
63- if (!$ this ->testsNodeAnalyzer ->isInTestClass ($ node )) {
61+ if (! $ this ->testsNodeAnalyzer ->isInTestClass ($ node )) {
6462 return null ;
6563 }
6664
67- if (!$ node ->var instanceof MethodCall) {
65+ if (! $ node ->var instanceof MethodCall) {
6866 return null ;
6967 }
7068
@@ -73,7 +71,7 @@ public function refactor(Node $node): null|MethodCall
7371 return null ;
7472 }
7573
76- if (!$ arg ->value instanceof MethodCall) {
74+ if (! $ arg ->value instanceof MethodCall) {
7775 return null ;
7876 }
7977
@@ -84,7 +82,7 @@ public function refactor(Node $node): null|MethodCall
8482 }
8583 }
8684
87- if (!isset ($ count )) {
85+ if (! isset ($ count )) {
8886 return null ;
8987 }
9088
You can’t perform that action at this time.
0 commit comments