rector/packages/VendorLocker/Reflection/MethodReflectionContractAnalyzer.php
2021-05-10 22:23:08 +00:00

19 lines
518 B
PHP

<?php
declare (strict_types=1);
namespace Rector\VendorLocker\Reflection;
use PHPStan\Reflection\ClassReflection;
final class MethodReflectionContractAnalyzer
{
public function hasInterfaceContract(\PHPStan\Reflection\ClassReflection $classReflection, string $methodName) : bool
{
foreach ($classReflection->getInterfaces() as $interfaceReflection) {
if ($interfaceReflection->hasMethod($methodName)) {
return \true;
}
}
return \false;
}
}