Checks if the object has the given method.

@param string $method The method to check.

@return bool Returns true if the property exists, false otherwise.

@see http://docs.php.net/manual/en/function.user-defined.php
@throws \InvalidArgumentException
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);
    }
568854
public function hasMethod($name)
    {
        $methods = $this->getMethods();
        foreach ($methods as $method) {
            if ($method->getName() == $name) {
                return true;
            }
        }

        return false;
    }
235317
public function setMethod($method) {

        if ( empty($method) || !is_string($method) ) throw new InvalidArgumentException("Invalid RPC method");

        $this->method = $method;

        return $this;

    }
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;
    }
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)]);
    }
181491
public function hasMethod($methodName)
    {
        $methodNameLower = strtolower($methodName);
        foreach ($this->methods as $name => $method) {
            if ($methodNameLower == $name) {
                return true;
            }
        }

        $extendsClassDefinition = $this->getExtendsClassDefinition();
        if ($extendsClassDefinition instanceof ClassDefinitionRuntime) {
            try {
                $extendsClassDefinition = $this->compiler->getInternalClassDefinition(
                    $extendsClassDefinition->getName()
                );
            } catch (\ReflectionException $e) {
                // Do nothing
                return false;
            }
        }

        while ($extendsClassDefinition instanceof self) {
            if ($extendsClassDefinition->hasMethod($methodName)) {
                return true;
            }

            $extendsClassDefinition = $extendsClassDefinition->getExtendsClassDefinition();
        }

        return false;
    }
872100
public static function exists(string $func): bool
    {
        if (strpos($func, "::") !== false) {
            list($class, $method) = explode("::", $func);
            return method_exists($class, $method);
        }
        return function_exists($func);
    }
455559
public function is($method) {
        $m = strtolower($method);
        if ( ($m == 'post' || $m == 'ajax') && $this->_method == 'ajax-post') {
            return TRUE;
        }
        return $m == $this->_method;
    }
635010
protected function checkMethodExist($method)
    {
        if (!method_exists($this, $method)) {
            if ($this->application->isDebugMode()) {
                return $this->createResponse(
                    sprintf('Called undefined method: %s.', get_class($this).'::'.$method),
                    500
                );
            } else {
                throw new \LogicException(sprintf('Called undefined method: %s.', get_class($this).'::'.$method));
            }
        }

        return true;
    }
106719
protected function assertMethod($method)
    {
        if (!is_string($method)) {
            $type = (is_object($method) ? get_class($method) . ' ' : '') . gettype($method);
            throw new \InvalidArgumentException("Method should be a string, not a $type");
        }
        
        if (preg_match('/[^a-z\-]/i', $method)) {
            $type = (is_object($method) ? get_class($method) . ' ' : '') . gettype($method);
            throw new \InvalidArgumentException("Invalid method '$method': "
                . "Method may only contain letters and dashes");
        }
    }
680939
public function methodSignatures( $method )
    {
        return array_key_exists( $method, $this->FunctionList ) ? $this->FunctionList[$method] : false;
    }
254220
public static function isAlwaysAllowed(string $method): bool
    {
        return in_array($method, [self::HEAD, self::GET]);
    }
960734
public function add($method)
    {
        if (!$method instanceof MethodInterface) {
            throw new \InvalidArgumentException('This Method must be a instance of \ClassGeneration\MethodInterface');
        }
        if ($method->getName() === null) {
            $method->setName('method' . ($this->count() + 1));
        }

        parent::set($method->getName(), $method);
        return true;
    }
1197654
private function checkMethodExist(string $method):int
    {
        if (in_array($method, $this->methodsReq)) {
            return (1);
        } else {
            new Server500(new \ArrayObject(array("explain" => "Unknown method $method for Allowed method request",
                "solution" => "Allowed methods request must be ".json_encode($this->methodsReq))));
        }
        return (0);
    }
1216212
public static function hasMethod(string $method, $objectOrClass): bool
    {
        try {
            $reflectionClass = self::getReflectionClass($objectOrClass);
            return $reflectionClass->hasMethod($method);
        } catch (Exception $e) {
            return false;
        }
    }
1092127
public function __isset($property)
	{
		if(!empty($property))
		{
			# generic isset check
			$call = "isset_".$property;
			
			if(method_exists($this, $call))
				return $this->{$call}() && true;
			
			# now to see if the value is set?
			$call = "getter_".$property;
			
			if(method_exists($this, $call))
				return $this->{$call}() !== null;
			
			/*
				if($this instanceof ArrayAccess)
					return $this->offsetExists($property);
			*/
		}
		
		return false;
	}
1058039
protected function _isMethodExists($method)
    {
        if ( $return = method_exists($this, $method) ) {
            ## it must be exists also be public accessible
            $ref    = $this->_newReflection();
            $ref    = $ref->getMethod($method);
            $return = $ref->isPublic();
        }

        return $return;
    }