Check for a expectation for given method on local mock.

@param string $method name of the method being checked
779255
protected function localMockHasExpectationsFor(string $method): bool
    {
        return $this->hasLocalMock() && $this->getLocalMock()->mockery_getExpectationsFor($method);
    }
798465
protected function _isMethodExists($method)
    {
        $return = method_exists($this, $method);
        if ($return) {
            ## it must be exists also be public accessible
            $ref    = $this->_newReflection();
            $ref    = $ref->getMethod($method);
            $return = $return && $ref->isPublic();
        }

        $ignored = $this->doWhichMethodIgnored();
        return $return && !in_array($method, $ignored);
    }
1277618
public function matches($method, $arguments)
    {
        foreach ($this->expectations as $expectation) {
            if ($expectation->matches($method, $arguments)) {
                return true;
            }
        }
        
        return false;
    }
118837
public function isSupportedMethod($method) {
        if (!is_string($method)) throw new IllegalTypeException('Illegal type of parameter $method: '.gettype($method));
        return isset($this->methods[strtoupper($method)]);
    }
1342052
public function isMethod( $method )
	{
		Deprecation::getInstance()
			->setErrorVersion( '0.8.4.7' )
			->setExceptionVersion( '0.9' )
			->message( 'Please use $request->getMethod()->is( $method ) instead' );
		return $this->method->is( $method );
	}
653809
private function checkMethodExists($method)
    {
        if (! $this->controllerClass->hasMethod($method)) {
            throw new MissingControllerMethodException(
                sprintf(
                    "Method %s::%s() is not defined in controller.",
                    $this->controllerClass->getShortName(),
                    $method
                )
            );
        }
    }
1136444
private static boolean validateReturnType(Method method, Class<?> expected) {
    Class<?> returnType = method.getReturnType();
    if (returnType == void.class) {
      return false;
    }
    if (returnType != expected) {
      String expectedType = "'" + expected.getName() + "'";
      if (expected != void.class) {
        expectedType = "'void' or " + expectedType;
      }
      throw new IllegalStateException(method.getDeclaringClass().getName()
          + "."
          + method.getName()
          + " must have return type of "
          + expectedType);
    }
    return true;
  }
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);
    }
752249
public function withMethod(string $method): self {
        if ($this->method === $method) {
            return $this;
        }

        $clone = clone $this;
        $clone->method = $method;

        return $clone;
    }
68465
public static function validateMethod($method)
    {
        if ($method === self::METHOD_POST ||
            $method === self::METHOD_PUT ||
            $method === self::METHOD_DELETE ||
            $method === self::METHOD_GET ||
            $method === self::METHOD_HEAD ||
            $method === self::METHOD_PATCH
        ) {
            return true;
        }

        throw new ClientException('Invalid request method \'' . $method . '\'');
    }
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);
    }
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;
		
	}
642229
public function setMethod($method)
    {
        $valid_methods = array(self::METHOD_POST, self::METHOD_GET);

        if (!in_array($method, $valid_methods)) {
            throw new SwatException("‘{$method}’ is not a valid form method.");
        }

        $this->method = $method;
    }
426168
protected function isMethodAllowed(?string $method)
    {
        if ($this->isAllMethodsAllowed()) {
            return true;
        }

        return in_array(strtoupper($method), $this->allowMethods);
    }
1245252
public static function setMethod($method) {

		if(false === is_string($method)) {
  			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($method)), E_USER_ERROR);
  		}

		$_SERVER['REQUEST_METHOD'] = strtoupper($method);
	}
223889
public function isValidHttpMethod($method)
    {
        $method = strtoupper($method);

        if (in_array('ANY', $this->methods)) {
            return true;
        }

        return (bool)in_array($method, $this->methods);
    }
1036653
public function setMethod($method)
    {
        if (is_string($method))
            $method = explode('|', $method);

        $this->method = array_map('strtoupper', $method);

        return $this;
    }