mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-25 04:03:55 +01:00
rename php.inc to php
This commit is contained in:
parent
09195aae13
commit
86d5bf7c8d
@ -82,11 +82,11 @@ final class NameTypeResolver implements PerNodeTypeResolverInterface
|
||||
return [$name];
|
||||
}
|
||||
|
||||
if (class_exists($classLikeReflection->getName())) {
|
||||
$useTraits = array_values((array) class_uses($classLikeReflection->getName()));
|
||||
} else {
|
||||
$useTraits = [];
|
||||
}
|
||||
// if (class_exists($classLikeReflection->getName())) {
|
||||
$useTraits = array_values((array) class_uses($classLikeReflection->getName()));
|
||||
// } else {
|
||||
// $useTraits = [];
|
||||
// }
|
||||
|
||||
$implementedInterfaces = $this->smartClassReflector->resolveClassInterfaces($classLikeReflection);
|
||||
$classParents = $this->smartClassReflector->resolveClassParents($classLikeReflection);
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
class SomeParentCallingClass extends \Rector\NodeTypeResolver\Tests\Source\AnotherClass // AnotherClass
|
||||
class SomeParentCallingClass extends \Rector\NodeTypeResolver\Tests\Source\AnotherClass
|
||||
{
|
||||
public function createContainer()
|
||||
{
|
@ -28,26 +28,26 @@ final class MethodCallTypeResolverTest extends AbstractNodeTypeResolverTest
|
||||
public function provideData(): Iterator
|
||||
{
|
||||
# on self call
|
||||
yield [__DIR__ . '/MethodCallSource/OnSelfCall.php.inc', 0, ['SomeParentCallingClass', AnotherClass::class]];
|
||||
yield [__DIR__ . '/MethodCallSource/OnSelfCall.php.inc', 1, ['SomeParentCallingClass', AnotherClass::class]];
|
||||
yield [__DIR__ . '/MethodCallSource/OnSelfCall.php', 0, ['SomeParentCallingClass', AnotherClass::class]];
|
||||
yield [__DIR__ . '/MethodCallSource/OnSelfCall.php', 1, ['SomeParentCallingClass', AnotherClass::class]];
|
||||
# on method call
|
||||
yield [__DIR__ . '/MethodCallSource/OnMethodCallCall.php.inc', 0, [
|
||||
yield [__DIR__ . '/MethodCallSource/OnMethodCallCall.php', 0, [
|
||||
'Rector\NodeTypeResolver\Tests\Source\AnotherClass',
|
||||
]];
|
||||
# on variable call
|
||||
yield [__DIR__ . '/MethodCallSource/OnVariableCall.php.inc', 0, [
|
||||
yield [__DIR__ . '/MethodCallSource/OnVariableCall.php', 0, [
|
||||
'Rector\NodeTypeResolver\Tests\Source\SomeClass',
|
||||
]];
|
||||
# on property call
|
||||
yield [__DIR__ . '/MethodCallSource/OnPropertyCall.php.inc', 0, [
|
||||
yield [__DIR__ . '/MethodCallSource/OnPropertyCall.php', 0, [
|
||||
'Rector\NodeTypeResolver\Tests\Source\SomeClass',
|
||||
]];
|
||||
# on magic class call
|
||||
yield [__DIR__ . '/MethodCallSource/OnMagicClassCall.php.inc', 0, [
|
||||
yield [__DIR__ . '/MethodCallSource/OnMagicClassCall.php', 0, [
|
||||
'Rector\NodeTypeResolver\Tests\Source\SomeClass',
|
||||
]];
|
||||
# on trait method call
|
||||
yield [__DIR__ . '/MethodCallSource/SomeClassWithTraitCall.php.inc', 0, [
|
||||
yield [__DIR__ . '/MethodCallSource/SomeClassWithTraitCall.php', 0, [
|
||||
'Rector\NodeTypeResolver\Tests\Source\SomeClass',
|
||||
]];
|
||||
}
|
||||
|
@ -36,40 +36,40 @@ final class NestedMethodCallTest extends AbstractNodeTypeResolverTest
|
||||
{
|
||||
# form chain method calls
|
||||
yield [
|
||||
__DIR__ . '/NestedMethodCallSource/FormChainMethodCalls.php.inc', 0, 'addRule', [
|
||||
__DIR__ . '/NestedMethodCallSource/FormChainMethodCalls.php', 0, 'addRule', [
|
||||
'Stub_Nette\Forms\Rules',
|
||||
],
|
||||
];
|
||||
yield [__DIR__ . '/NestedMethodCallSource/FormChainMethodCalls.php.inc', 1, 'addCondition', [
|
||||
yield [__DIR__ . '/NestedMethodCallSource/FormChainMethodCalls.php', 1, 'addCondition', [
|
||||
'Stub_Nette\Forms\Controls\TextInput',
|
||||
'Stub_Nette\Forms\Controls\TextArea',
|
||||
]];
|
||||
yield [__DIR__ . '/NestedMethodCallSource/FormChainMethodCalls.php.inc', 2, 'addText', [
|
||||
yield [__DIR__ . '/NestedMethodCallSource/FormChainMethodCalls.php', 2, 'addText', [
|
||||
'Stub_Nette\Application\UI\Form',
|
||||
'Stub_Nette\Forms\Form',
|
||||
]];
|
||||
# nested different method calls
|
||||
yield [__DIR__ . '/NestedMethodCallSource/OnMethodCallCallDifferentType.php.inc', 0, 'getParameters', [
|
||||
yield [__DIR__ . '/NestedMethodCallSource/OnMethodCallCallDifferentType.php', 0, 'getParameters', [
|
||||
AnotherClass::class,
|
||||
]];
|
||||
yield [__DIR__ . '/NestedMethodCallSource/OnMethodCallCallDifferentType.php.inc', 1, 'createAnotherClass', [
|
||||
yield [__DIR__ . '/NestedMethodCallSource/OnMethodCallCallDifferentType.php', 1, 'createAnotherClass', [
|
||||
ClassWithFluentNonSelfReturn::class,
|
||||
]];
|
||||
# nested method calls
|
||||
yield [
|
||||
__DIR__ . '/NestedMethodCallSource/NestedMethodCalls.php.inc',
|
||||
__DIR__ . '/NestedMethodCallSource/NestedMethodCalls.php',
|
||||
0,
|
||||
'getParameters',
|
||||
[AnotherClass::class],
|
||||
];
|
||||
yield [
|
||||
__DIR__ . '/NestedMethodCallSource/NestedMethodCalls.php.inc',
|
||||
__DIR__ . '/NestedMethodCallSource/NestedMethodCalls.php',
|
||||
1,
|
||||
'callAndReturnSelf',
|
||||
[AnotherClass::class],
|
||||
];
|
||||
# nested method calls
|
||||
yield [__DIR__ . '/NestedMethodCallSource/NestedMethodCalls.php.inc', 2, 'createAnotherClass', [
|
||||
yield [__DIR__ . '/NestedMethodCallSource/NestedMethodCalls.php', 2, 'createAnotherClass', [
|
||||
ClassWithFluentNonSelfReturn::class,
|
||||
]];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user