[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:
Abdul Malik Ikhsan 2020-12-23 21:37:17 +07:00 committed by GitHub
parent cd58dd958e
commit c11a506b2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -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();

View File

@ -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();
}
}