Check if method exists.

@since 1.0.2

@param array $method → [class|object, method].

@return boolean
357073
private static function validate_method( $method ) {

		if ( $method && isset( $method[0] ) && isset( $method[1] ) ) {
			if ( method_exists( $method[0], $method[1] ) ) {
				return true;
			}
		}

		return false;
	}
1213534
public function hasMethod($name)
    {
        return method_exists($this, $name)
            || (isset($this->_hookTrait) && $this->hookHasCallbacks('method-'.$name))
            || $this->hasGlobalMethod($name);
    }
1154400
public function hasMethod($action) {
		return array_key_exists($action, $this->actions())
        || method_exists($this, $action.config('app.action'));
	}
51672
public function offsetExists($offset)
    {
        // We only check isset on the array, if it is an object we return true as the object could be overloaded
        if (! is_array($this->object)) {
            return true;
        }

        if ($method = $this->getPresenterMethodFromVariable($offset)) {
            $result = $this->$method();

            return isset($result);
        }

        return isset($this->object[$offset]);
    }
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);
    }
309218
protected function exists(array $array, $key)
    {
        if (isset($array[$key])) {
            return true;
        }

        foreach (explode(".", $key) as $part) {
            if (!is_array($array) or !isset($array[$part])) {
                return false;
            }

            $array = $array[$part];
        }

        return true;
    }
923028
protected function hasMethod($method, ClassMetadataInfo $metadata)
    {
        if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) {
            // don't generate method if its already on the base class.
            $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name);

            if ($reflClass->hasMethod($method)) {
                return true;
            }
        }

        // check traits for existing method
        foreach ($this->getTraits($metadata) as $trait) {
            if ($trait->hasMethod($method)) {
                return true;
            }
        }

        return (
            isset($this->staticReflection[$metadata->name]) &&
            in_array(strtolower($method), $this->staticReflection[$metadata->name]['methods'])
        );
    }
779255
protected function localMockHasExpectationsFor(string $method): bool
    {
        return $this->hasLocalMock() && $this->getLocalMock()->mockery_getExpectationsFor($method);
    }
744972
public function hasMethod($nameOrMethod): bool {
		if ($nameOrMethod instanceof PhpMethod) {
			$nameOrMethod = $nameOrMethod->getName();
		}

		return $this->methods->has($nameOrMethod);
	}
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 . '\'');
    }
943217
static public function findHelperFor($method)
    {
        if (isset(self::$registry[$method])) {
            return self::$helpers[self::$registry[$method]];
        }
        
        foreach (self::$helpers as $helperName => $helper) {
            if (method_exists($helper, $method)) {
                self::$registry[$method] = $helperName;
                return $helper;
            }
        }
        
        return false;
    }
589363
public static function getExistingMethodSlot(ClassMethod $method)
    {
        $className = $method->getClassDefinition()->getCompleteName();
        $methodName = $method->getName();

        if (isset(self::$cacheMethodSlots[$className][$methodName])) {
            return self::$cacheMethodSlots[$className][$methodName];
        }

        return 0;
    }
1213048
public function supports( $methods ) {
		$support = 0;
		$methods = (array)$methods;

		foreach ( $methods as $method ) {
			if ( method_exists( $this, $method ) ) {
				$support++;
				continue;
			}
		}

		return count( $methods ) === $support;
	}
568854
public function hasMethod($name)
    {
        $methods = $this->getMethods();
        foreach ($methods as $method) {
            if ($method->getName() == $name) {
                return true;
            }
        }

        return false;
    }
79064
protected function findClass($method)
	{
		if (!preg_match("/^add([a-zA-Z]+)/", $method, $matches)) {
			return false;
		}

		$className = "\\HtmlForm\\Elements\\{$matches[1]}";

		if (!class_exists($className)) {
			return false;
		}

		return $className;
	}
298032
private function validateMethod($method)
    {
        $prefix = substr($method, 0, 3);

        if ($prefix === 'get' || $prefix === 'set' || $prefix === 'has') {
            return lcfirst(substr($method, 3));
        }

        $prefix = substr($prefix, 0, 2);

        if ($prefix === 'is') {
            return lcfirst(substr($method, 2));
        }
    }
1110663
function hasMethod($methodName)
    {
        if (isset($this->_t__methods[$methodName]))
            return true;

        # check bind object
        $return = false;

        $bind = $this->getBindTo();
        if (!$bind instanceof self) {
            $return = method_exists($bind, $methodName);
        }

        return $return;
    }