Get or set the methods.

@param array|null $methods

@return array
486707
protected function methods(array $methods = null)
    {
        return is_null($methods)
            ? $this->methods
            : ($this->methods = $methods);
    }
1288360
private function methodAllowedTransform(string $methods):array
    {
        if (is_string($methods) || $this->isJsonMercureFormat($methods)) {
            switch ($methods) {
                case $this->isJsonMercureFormat($methods) == 1:
                    $r = $this->trsJsonMercureToArray($methods);
                    foreach ($r as $one) {
                        if ($this->checkMethodExist($one)) {
                            continue;
                        }
                    }
                    return ($r);
                    break;
                case is_string($methods):
                    if ($this->checkMethodExist($methods)) {
                        return (array($methods));
                    }
                    break;
                default:
                    new Server500(new \ArrayObject(
                        array("explain" => "Invalid format for Allowed methods request (m_allow)",
                            "solution" => "Please check the 'm_allow' tag format")
                    ));
            }
        } else {
            new Server500(new \ArrayObject(
                array("explain" => "Invalid format for Allowed methods request (m_allow)",
                    "solution" => "Please check the 'm_allow' tag format")
            ));
        }
        return (array());
    }
372224
public function method($method = null)
    {
        if ($method === null) {
            return $this->get('REQUEST_METHOD');
        }
        $this->set("REQUEST_METHOD", $method);
        return $this;
    }
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;
	}
950002
public function getMethods()
    {
        if (!$this->__methods)
        {
            $methods = array();
            $object = $this->getDelegate();

            if (!($object instanceof KObjectMixable))
            {
                $reflection = new ReflectionClass($object);
                foreach ($reflection->getMethods() as $method) {
                    $methods[] = $method->name;
                }
            }
            else $methods = $object->getMethods();

            $this->__methods = $methods;
        }

        return $this->__methods;
    }
20662
public final function headers(array $headers = null): array
    {
        return ($headers == null) ? $this->getHeaders() : $this->setHeaders($headers);
    }
483563
public function method(string $method, string ...$methods): self
    {
        array_unshift($methods, $method);

        return $this->setAllowedMethods($methods);
    }
658552
private function getMethodSignature($method)
    {
        $validMethod = isset($this->methods[$method])
            && is_array($this->methods[$method])
            && count($this->methods[$method]) >= 2;

        if ($validMethod) {
            return $this->methods[$method];
        }

        return null;
    }
1029625
private static function getArgs(array $args = null, \ReflectionMethod $method = null)
    {
        $config = [];
        if ($args && !empty($args)) {
            foreach ($args as $arg) {
                $config[$arg->name] = ['type' => $arg->type] + ($arg->description ? ['description' => $arg->description] : []);
            }
        } elseif ($method) {
            $config = self::guessArgs($method);
        }

        return $config;
    }
638353
public function clearCache($methods = null)
    {
        if ($methods === null || $methods === 'all') {
            $this->cache = [];
        } else {
            foreach ((array) $methods as $method) {
                $this->cache[$method] = [];
                // we may need to clear out the record cache in the zone model
                // to avoid unintuitive behaviour
                if (($method == 'recLoad' || !$method) && $method !== false) {
                    $this->zone->clearRecordCache();
                }
            }
        }

        return $this;
    }
984383
static function getAnnotations($class, $method = NULL)
	{
		$result = [];
		foreach (Arr::merge(self::getClassAnnotations($class), NULL !== $method
			? self::getMethodAnnotations($method, $class) : []) as $obj) {
			$result[get_class($obj)] = $obj;
		};

		return $result;
	}
865367
protected function getMethods()
    {
        if ($this->option('plain')) {
            return [];
        }

        $methods = ['all', 'find', 'create', 'update', 'delete'];

        if (($only = $this->option('only')) && $only != '') {
            $methods = array_flip(array_only(array_flip($methods), $this->getArray($only)));
        }

        if (($except = $this->option('except')) && $except != '') {
            $methods = array_flip(array_except(array_flip($methods), $this->getArray($except)));
        }

        return $methods;
    }
983170
public function allowMethods(array $methods = []): Route
    {
        $this->methods = [];
        foreach ($methods as $method) {
            $this->allowMethod($method);
        }

        return $this;
    }
1166197
protected function getExtraMethodConfig($method)
    {
        // Lazy define methods
        if (!isset(self::$extra_methods[static::class])) {
            $this->defineMethods();
        }

        if (isset(self::$extra_methods[static::class][strtolower($method)])) {
            return self::$extra_methods[static::class][strtolower($method)];
        }
        return null;
    }
446296
public final function getMethodArguments(string $method = null): ?array
    {
        return $method ? $this->methodArguments[$method] ?? null : $this->methodArguments;
    }
460995
public function inflectionMethod($method = null)
    {
        if ($method !== null) {
            $this->setInflectionMethod($method);
        }

        return $this->getInflectionMethod();
    }
388685
protected function _getMethods($object)
    {
        if (is_string($object)) {
            $className = $object;
        } else {
            $className = get_class($object);
        }
        $methods = get_class_methods($className);

        if (self::$_config['sort']['methods']) {
            sort($methods);
        }
        return $methods;
    }