mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-09 17:41:24 +01:00
b2c44bfdb0
[DowngradePhp72] Handle anonymous class override class method on DowngradeParameterTypeWideningRector (#777)
23 lines
570 B
PHP
23 lines
570 B
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace Rector\DowngradePhp72\NodeAnalyzer;
|
|
|
|
use PHPStan\Reflection\ClassReflection;
|
|
final class SealedClassAnalyzer
|
|
{
|
|
/**
|
|
* This method is perfectly sealed, nothing to downgrade here
|
|
*/
|
|
public function isSealedClass(\PHPStan\Reflection\ClassReflection $classReflection) : bool
|
|
{
|
|
if (!$classReflection->isClass()) {
|
|
return \false;
|
|
}
|
|
if (!$classReflection->isFinal()) {
|
|
return \false;
|
|
}
|
|
return \count($classReflection->getAncestors()) === 1;
|
|
}
|
|
}
|