mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-22 18:54:39 +01:00
19 lines
518 B
PHP
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;
|
|
}
|
|
}
|