mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-24 03:35:01 +01:00
skip non-existing method
This commit is contained in:
parent
5edcae8d69
commit
2ad9dd97e4
@ -95,6 +95,10 @@ PHP
|
||||
|
||||
[$class, $method] = $arrayCallable;
|
||||
|
||||
if (! method_exists($class, $method)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$methodReflection = new ReflectionMethod($class, $method);
|
||||
if ($methodReflection->getNumberOfParameters() > 0) {
|
||||
return null;
|
||||
|
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\CodeQuality\Tests\Rector\Array_\ArrayThisCallToThisMethodCallRector\Fixture;
|
||||
|
||||
class SkipNonExistingMethod
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$values = [1, 5, 3];
|
||||
usort($values, [$this, 'compareSizeThat']);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user