Skip to content

Commit b8a8366

Browse files
authored
[TypeDeclarationDocblocks] Skip all together if one of calls is first class callable (#7358)
* [TypeDeclarationDocblocks] Skip all together if one of calls is first class callable * Fix
1 parent 966cfd9 commit b8a8366

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace Rector\Tests\TypeDeclarationDocblocks\Rector\Class_\ClassMethodArrayDocblockParamFromLocalCallsRector\Fixture;
4+
5+
class SkipWithFirstClassCallable
6+
{
7+
public function go()
8+
{
9+
$this->run(['item1', 'item2']);
10+
11+
$this->run(...)([1, 2]);
12+
}
13+
14+
private function run(array $items)
15+
{
16+
}
17+
}

rules/TypeDeclaration/NodeAnalyzer/CallTypesResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function resolveTypesFromCalls(array $calls): array
6767
foreach ($calls as $call) {
6868
foreach ($call->args as $position => $arg) {
6969
if ($this->shouldSkipArg($arg)) {
70-
continue;
70+
return [];
7171
}
7272

7373
/** @var Arg $arg */

0 commit comments

Comments
 (0)