@param \PHPMD\Node\MethodNode $method

@return bool
518331
protected function getFactoryCallsNumber(MethodNode $method)
    {
        $factoryCallNumber = 0;
        $primaryPrefixes = $method->findChildrenOfType('MemberPrimaryPrefix');

        foreach ($primaryPrefixes as $key => $primaryPrefix) {
            if (!$this->isChildNameEqual($primaryPrefix, 0, static::PSEUDO_VAR_THIS)) {
                continue;
            }

            if (!$this->isChildNameEqual($primaryPrefix, 1, static::OBJECT_OPERATOR)) {
                continue;
            }

            if (!isset($primaryPrefixes[$key + 1])) {
                continue;
            }

            if ($this->isChildNameEqual($primaryPrefixes[$key + 1], 0, static::GET_FACTORY_METHOD)) {
                $factoryCallNumber++;
            }
        }

        return $factoryCallNumber;
    }
1041731
private function hasCorrectPrefix(MethodNode $node)
    {
        foreach ($this->allowedPrefixes as $prefix) {
            if ($prefix === substr($node->getImage(), 0, strlen($prefix))) {
                return true;
            }
        }

        return false;
    }
111355
public static function hasMethod($object, $method)
    {
        if (empty($object)) {
            return false;
        }
        if (method_exists($object, $method)) {
            return true;
        }
        return method_exists($object, 'hasMethod') && $object->hasMethod($method);
    }
222321
public function methodExists($method)
    {
        $key = 'method.'.$method;

        if (!self::_cache($this)->offsetExists($key)) {
            $result = false;

            if (method_exists($this, $method)) {
                $result = true;
            } elseif (self::_cache($this)->offsetExists('behavior.'.$method)) {
                $result = self::_cache($this)->offsetGet('behavior.'.$method);
            } else {
                $behaviors = $this->getRepository()->getBehaviors();

                foreach ($behaviors as $behavior) {
                    if (in_array($method, $behavior->getMixableMethods($this))) {
                        $result = true;
                        break;
                    }
                }
            }

            self::_cache($this)->offsetSet($key, $result);
        }

        return self::_cache($this)->offsetGet($key);
    }
1011352
protected static function method_exists( $object, $method )
    {
        if ( !is_array( $method ) )
        {
            $method = array($method);
        }

        foreach ( $method as $_method )
        {
            if ( method_exists( $object, $_method ) )
            {
                return $_method;
            }
        }

        return false;
    }
291756
private function checkMethodHasValidPrefix($methodName, $methodPrefix = [])
    {
        if (in_array('*', $methodPrefix)) {
            return true;
        }
        foreach ($methodPrefix as $prefix) {
            if (strpos($methodName, $prefix) === 0) {
                return true;
            }
        }
    }
800350
public function hasMethod( $methodName, $callableOnly = TRUE )
	{
		if( $callableOnly )
			return method_exists( $this, $methodName ) && is_callable( array( $this, $methodName ) );
		else
			return method_exists( $this, $methodName );
	}
230323
public final function isAllowedRequestMethod(string $method): bool
    {
        return $this->allowedRequestMethods == null || in_array($method, (array) $this->allowedRequestMethods);
    }
149267
protected function applyRule(MethodNode $method)
    {
        if (substr($method->getName(), 0, 6) !== 'create') {
            return;
        }

        $count = count($method->findChildrenOfType('AllocationExpression'));
        if ($count === 1) {
            return;
        }

        if ($this->isParentCall($method)) {
            return;
        }
        if ($this->isIndirectFactoryMethod($method)) {
            return;
        }

        $throwStatements = $method->findChildrenOfType('ThrowStatement');
        if ($count - count($throwStatements) === 1) {
            return;
        }

        $methodName = $method->getParentName() . '::' . $method->getName() . '()';
        $className = $method->getFullQualifiedName();

        $message = sprintf(
            '%s in %s contains %s new statements which violates rule "%s"',
            $methodName,
            $className,
            $count,
            static::RULE
        );

        $this->addViolation($method, [$message]);
    }
84384
protected function isActionMethodValid($methodName)
    {
        // try {
            if (!$this->selfRefl->hasMethod($methodName)) {
                return false;
            }
            $method = $this->selfRefl->getMethod($methodName);
            
            return
                // $method->getDeclaringClass()->getName() == $this->selfRefl->getName() &&
                $method->isPublic();
        // } catch (\ReflectionException $e) {
            // return false;
        // }
    }
257184
protected function applyRule(MethodNode $node): void
    {
        $constant = $node->getFirstChildOfType('ConstantPostfix');

        if ($constant === null) {
            return;
        }

        if (!$this->isPropelQueryConstant($constant->getName())) {
            return;
        }

        $methodName = $node->getName();

        if ($this->isPropelQueryFactoryMethod($methodName)) {
            return;
        }

        $class = $node->getParentName();

        $message = sprintf(
            '%s violates rule "%s"',
            "{$class}::{$methodName}()",
            static::RULE
        );

        $this->addViolation($node, [$message]);
    }
1111999
public static boolean hasAnnotation(final MethodNode methodNode, final Class<? extends Annotation> annotationClass) {
        return !methodNode.getAnnotations(new ClassNode(annotationClass)).isEmpty();
    }
1203040
public function isMethodAllowed(string $method): bool
    {
        $methods = $this->getAllow();
        if ($methods) {
            return in_array(strtoupper($method), $methods);
        }

        return false;
    }
379045
public function allow_method($methods){
        $methods = array_map('strtoupper',(array)$methods);
        foreach((array)$methods as $method){
            if($method == 'HEAD'){
                $method = 'GET';
            }
            if(in_array($method, $this->methods)){
                return true;
            }
        }
        return false;
    }
1119570
private function checkMethod(Request $request, $method)
    {
        if(Text::isEmpty($method))
        {
            return true;
        }
        else if(is_array($method))
        {
            return in_array($request->getMethod(), $method);
        }
        else
        {
            return $method === $request->getMethod();
        }
    }
1268737
protected function applyRule(MethodNode $method)
    {
        if ($method->getName() !== '__construct') {
            return;
        }

        $params = $method->getParameters();
        if (count($params) === 1) {
            return;
        }

        $message = sprintf(
            'The %s is having %s parameters which violates the rule "%s"',
            count($params),
            $method->getFullQualifiedName(),
            static::RULE
        );

        $this->addViolation($method, [$message]);
    }
224885
public function isMethod($methods)
    {
        if (is_array($methods)) {
            return in_array($this->getMethod(), $methods);
        }

        if (is_string($methods)) {
            return ($this->getMethod() == $methods);
        }

        return false;
    }