/** * @param \PHPStan\Reflection\ClassReflection $classReflection * @param string $propertyName * @return \PHPStan\Reflection\MethodReflection|null */ private function getMethodByProperty(ClassReflection $classReflection, string $propertyName) { $getterMethodName = sprintf('get%s', ucfirst($propertyName)); if (!$classReflection->hasMethod($getterMethodName)) { return null; } return $classReflection->getMethod($getterMethodName); }