mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-21 09:42:45 +01:00
[PHP 7.0] Skip StaticCallOnNonStaticToInstanceCallRector on dynamic static call (#4962)
* [PHP 7.0] Fixes #4954 Skip StaticCallOnNonStaticToInstanceCallRector on dynamic static call * fixture
This commit is contained in:
parent
cd58dd958e
commit
c11a506b2b
@ -167,6 +167,10 @@ CODE_SAMPLE
|
||||
|
||||
private function isInstantiable(string $className): bool
|
||||
{
|
||||
if (! class_exists($className)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$reflectionClass = new ReflectionClass($className);
|
||||
$classConstructorReflection = $reflectionClass->getConstructor();
|
||||
|
||||
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Php70\Tests\Rector\StaticCall\StaticCallOnNonStaticToInstanceCallRector\Fixture;
|
||||
|
||||
class SkipDynamicStaticCall
|
||||
{
|
||||
public function getMethod(): object
|
||||
{
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
$store = $this->getMethod();
|
||||
$store::foo();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user