mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-19 06:18:07 +01:00
Add namespaced function call test
This commit is contained in:
parent
1db0b88115
commit
2783013a5b
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Rector\Tests\FunctionToStaticCallRector;
|
||||||
|
|
||||||
|
class SomeClass
|
||||||
|
{
|
||||||
|
public function someMethod()
|
||||||
|
{
|
||||||
|
\AnotherStaticClass::render('template', []);
|
||||||
|
}
|
||||||
|
}
|
@ -21,6 +21,7 @@ final class FunctionToMethodCallRectorTest extends AbstractRectorTestCase
|
|||||||
public function provideWrongToFixedFiles(): Iterator
|
public function provideWrongToFixedFiles(): Iterator
|
||||||
{
|
{
|
||||||
yield [__DIR__ . '/Wrong/wrong.php.inc', __DIR__ . '/Correct/correct.php.inc'];
|
yield [__DIR__ . '/Wrong/wrong.php.inc', __DIR__ . '/Correct/correct.php.inc'];
|
||||||
|
yield [__DIR__ . '/Wrong/wrong2.php.inc', __DIR__ . '/Correct/correct2.php.inc'];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function provideConfig(): string
|
protected function provideConfig(): string
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Rector\Tests\FunctionToStaticCallRector;
|
||||||
|
|
||||||
|
class SomeClass
|
||||||
|
{
|
||||||
|
public function someMethod()
|
||||||
|
{
|
||||||
|
\SomeNamespaced\view('template', []);
|
||||||
|
}
|
||||||
|
}
|
@ -2,3 +2,4 @@ services:
|
|||||||
Rector\Rector\Function_\FunctionToStaticCallRector:
|
Rector\Rector\Function_\FunctionToStaticCallRector:
|
||||||
$functionToMethodCall:
|
$functionToMethodCall:
|
||||||
'view': ['SomeStaticClass', 'render']
|
'view': ['SomeStaticClass', 'render']
|
||||||
|
'SomeNamespaced\view': ['AnotherStaticClass', 'render']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user