Checks "$this->someMethod()->anotherMethod()"

@param string[] $methods
169673
public function isTypeAndChainCalls(Node $node, string $type, array $methods): bool
    {
        if (! $node instanceof MethodCall) {
            return false;
        }

        // node chaining is in reverse order than code
        $methods = array_reverse($methods);

        foreach ($methods as $method) {
            $activeMethodName = $this->nameResolver->resolve($node);
            if ($activeMethodName !== $method) {
                return false;
            }

            $node = $node->var;
            if ($node instanceof MethodCall) {
                continue;
            }
        }

        $variableTypes = $this->nodeTypeResolver->resolve($node);

        return in_array($type, $variableTypes, true);
    }
494035
final public function hasMethod($method)
    {
        if (!Str::is($method)
            || !Str::match($method, "/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/")
        ) {
            throw new \InvalidArgumentException(
                "The \$method parameter must be a string and follow the PHP rules of method naming."
            );
        }

        return method_exists($this, $method);
    }
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();
        }
    }
1349508
public void setAllowedMethods(String[] methods)
    {
        StringBuffer b = new StringBuffer();
        _methods=methods;
        _methodMap.clear();
        for (int i=0;i<methods.length;i++)
        {
            _methodMap.put(methods[i],methods[i]);
            if (i>0)
                b.append(',');
            b.append(methods[i]);
        }
        _allowed=b.toString();
    }
473611
public static function classHasMethod($method, $class) {
        $methods = self::classMethods($class);

        if (!in_array($method, $methods)) {
          return false;
        }

        return true;
    }
1072097
protected function matchMethods($method)
    {
        if (empty($this->methods)) {
            return true;
        }
        if (in_array($method, $this->methods)) {
            return true;
        }

        return false;
    }
844635
public function setMethod(string $method): void
    {
        if (!\in_array($method, $this->getAvailableMethods(), true)) {
            throw new SessionException(\sprintf('Method unknowed: %s', $method));
        }

        $this->method = $method;
    }
542135
public function setMethods($methods)
    {
        $this->methods = array_map('strtoupper', (array) $methods);
        $this->compiled = null;

        return $this;
    }
7586
private function assertHttpMethod($method) {
        if (!$this->assertString($method)) return false;
        $validHttpMethods = array(
            'GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT', 'PATCH', 'LINK', 'UNLINK'
        );
        if (!in_array($method, $validHttpMethods)) return false;
        return true;
    }
167078
public function checkMethod ($method)
	{
		
		// Method name
		
		$method	= strtolower ($method);
		
		// Get module class name
		
		$class	= $this->getModuleClass ();
		
		// Get methods
		
		$this->getMethods ();
		
		// Loop through the methods
		
		foreach ($this->methods as $obj)
		{
			
			// If the method names match return TRUE and the method exists in the class
			
			if (strtolower ($obj->get ('name')) == $method && method_exists ($class, $method))
			{
				return TRUE;
			}
			
		}
		
		// Return FALSE
		
		return FALSE;
		
	}
1212755
private function methods($methods): void
    {
        if (is_callable($methods)) {
            if ($methods instanceof Closure) {
                $this->options["methods"] = $methods->bindTo($this);
            } else {
                $this->options["methods"] = $methods;
            }
        } else {
            $this->options["methods"] = (array) $methods;
        }
    }
383407
public function addAllowedMethods(array $methods): MethodNotAllowed
    {
        $this->allowedMethods = array_merge($this->allowedMethods, $methods);

        return $this;
    }
716388
public function & via(...$methods){
      $this->methods = [];
      foreach ($methods as $method){
        $this->methods[strtolower($method)] = true;
      }
      return $this;
    }
787478
private static function methodExists(string $method, string $className): bool
    {
        return method_exists($className, $method) || resolve($className)->hasMethod($method);
    }
821918
private function init($method)
    {
        if (is_string($method) && method_exists($this, $method))
        {
            return $this->$method();
        }

        return $method();
    }
1091240
protected static function checkMethods($value, $method)
    {
        $valid = false;
        if ($value === 'AJAX' && self::isAjax() && $value === $method) {
            $valid = true;
        } elseif ($value === 'AJAXP' && self::isAjax() && $method === 'POST') {
            $valid = true;
        } elseif (in_array($value, explode('|', self::$validMethods)) && ($value === $method || $value === 'ANY')) {
            $valid = true;
        }

        return $valid;
    }
1226713
private static boolean containsMethod(Method method, List<Method> methods) {
    if(methods != null) {
      for(Method aMethod : methods){
        if(method.getName().equals(aMethod.getName())) {
          return true;
        }
      }
    }
    return false;
  }