Skip to content

Commit c2978af

Browse files
calebdwGeniJaho
andauthored
fix: skip first class callable in DispatchToHelperFunctionsRector (#391)
Co-authored-by: Geni Jaho <[email protected]>
1 parent ab3c25f commit c2978af

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/Rector/StaticCall/DispatchToHelperFunctionsRector.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ public function getNodeTypes(): array
5858
return [StaticCall::class];
5959
}
6060

61+
/** @param StaticCall $node */
6162
public function refactor(Node $node): ?Node
6263
{
63-
if (! $node instanceof StaticCall) {
64+
if ($node->isFirstClassCallable()) {
6465
return null;
6566
}
6667

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace RectorLaravel\Tests\Rector\StaticCall\DispatchToHelperFunctionsRector\Fixture;
4+
5+
use RectorLaravel\Tests\Rector\StaticCall\DispatchToHelperFunctionsRector\Source\TestEvent;
6+
use RectorLaravel\Tests\Rector\StaticCall\DispatchToHelperFunctionsRector\Source\TestJob;
7+
8+
TestJob::dispatch(...);
9+
TestJob::dispatchSync(...);
10+
TestEvent::dispatch(...);

0 commit comments

Comments
 (0)