Skip to content

Commit 548cec4

Browse files
committed
cover with test
1 parent d185583 commit 548cec4

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Rector\Tests\Renaming\Rector\MethodCall\RenameDeprecatedMethodCallRector\Fixture;
4+
5+
use Rector\Tests\Renaming\Rector\MethodCall\RenameDeprecatedMethodCallRector\Source\MagicMethodApiClient;
6+
7+
function skipMagicMethodSuggestion(MagicMethodApiClient $apiClient)
8+
{
9+
// suggested fetchData() exists only as a @method magic method, not a real native one
10+
return $apiClient->getData();
11+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Rector\Tests\Renaming\Rector\MethodCall\RenameDeprecatedMethodCallRector\Source;
6+
7+
/**
8+
* @method array fetchData()
9+
*/
10+
final class MagicMethodApiClient
11+
{
12+
/**
13+
* @deprecated use fetchData() instead
14+
*/
15+
public function getData(): array
16+
{
17+
return [];
18+
}
19+
20+
public function __call(string $name, array $arguments): array
21+
{
22+
return [];
23+
}
24+
}

0 commit comments

Comments
 (0)