Returns the registered {@link MethodConfiguration}s for the given handler.

@param object $handler
@return MethodConfiguration[]
543988
public function methodsFor($handler) : array
    {
        $handlerClass = get_class($handler);
        if (!array_key_exists($handlerClass, $this->configMap)) {
            $handlerClassObject = ObjectClass::forName($handlerClass);
            $handlerConfig = [];
            foreach ($this->configMap as $class => $currentConfigs) {
                if (ObjectClass::forName($class)->isAssignableFrom($handlerClassObject)) {
                    $handlerConfig = array_merge($handlerConfig, $currentConfigs);
                }
            }
            $this->configMap[$handlerClass] = $handlerConfig;
        }
        return $this->configMap[$handlerClass];
    }
656888
public function create(callable $handler): callable
    {
        foreach ($this->wrappers as $wrapper) {
            $handler = $wrapper->wrap($handler);
        }

        return $handler;
    }
339298
public function get_content_handler($handler = null)
	{
		if ( ! empty($this->handler_object))
		{
			return $this->handler_object;
		}

		// When not yet set, use $handler or detect the preferred handler (string = string, otherwise serialize)
		if (empty($this->content_handler) && empty($handler))
		{
			if ( ! empty($handler))
			{
				$this->content_handler = $handler;
			}
			if (is_string($this->contents))
			{
				$this->content_handler = \Config::get('cache.string_handler', 'string');
			}
			else
			{
				$type = is_object($this->contents) ? get_class($this->contents) : gettype($this->contents);
				$this->content_handler = \Config::get('cache.'.$type.'_handler', 'serialized');
			}
		}

		$class = '\\Cache_Handler_'.ucfirst($this->content_handler);
		$this->handler_object = new $class();

		return $this->handler_object;
	}
272071
private function getHandler($handler): FormHandlerInterface
    {
        if (is_string($handler)) {
            if (!isset($this->handlers[$handler])) {
                $handler = new $handler();
            } else {
                $handler = $this->handlers[$handler];
            }
        }

        if (!$handler instanceof FormHandlerInterface) {
            throw new InvalidHandlerException(FormHandlerInterface::class, $handler);
        }

        return $handler;
    }
261861
public function to($handler): RegexRouter
    {
        if (! \is_string($handler) && ! \is_object($handler) && ! \is_callable($handler)) {
            throw new Exception\InvalidArgumentException(\sprintf(
                'Invalid handler provided. Expected type is string, object or callable but type of %s given.',
                \gettype($handler)
            ));
        }

        if (null === $this->tmpPattern) {
            throw new Exception\RuntimeException(\sprintf(
                'Cannot map handler %s to a pattern. Please use method route before calling method to',
                \is_object($handler)
                    ? \get_class($handler)
                    : (\is_string($handler) ? $handler : \gettype($handler))
            ));
        }

        $this->patternMap[] = [$this->tmpPattern => $handler];

        $this->tmpPattern = null;

        return $this;
    }
1219443
public function getByHandle($handle)
    {
        return isset($this->converters[$handle]) ? $this->converters[$handle] : null;
    }
197374
static public function getHandlerInstance( ezpSessionHandler $handler = null )
    {
        if ( self::$handlerInstance === null )
        {
            if ( $handler === null )
            {
                $ini = eZINI::instance();
                if ( $ini->variable( 'Session', 'Handler' ) !== '' )
                {
                    $optionArray = array(
                        'iniFile'       => 'site.ini',
                        'iniSection'    => 'Session',
                        'iniVariable'   => 'Handler',
                        'handlerParams' => array( self::$hasSessionCookie )
                    );

                    $options = new ezpExtensionOptions( $optionArray );
                    self::$handlerInstance = eZExtension::getHandlerClass( $options );
                }
            }
            else
            {
                self::$handlerInstance = $handler;
            }
            if ( !self::$handlerInstance instanceof ezpSessionHandler )
            {
                self::$handlerInstance = new ezpSessionHandlerPHP( self::$hasSessionCookie );
            }
        }
        return self::$handlerInstance;
    }
566449
public function map($pattern, $handler = null, $methods = '*')
    {
        $this->routes[$pattern] = [
            'handler' => $handler,
            'methods' => $methods,
        ];
    }
1242236
protected function methodToConfiguration(ReflectionMethod $method): ?array
    {
        // Get a field from annotation, or an empty one
        /** @var Field $field */
        $field = $this->getAnnotationReader()->getMethodAnnotation($method, Field::class) ?? new Field();

        if (!$field->type instanceof Type) {
            $this->convertTypeDeclarationsToInstances($method, $field);
            $this->completeField($field, $method);
        }

        return $field->toArray();
    }
750987
protected function methodToConfiguration(ReflectionMethod $method): ?array
    {
        // Silently ignore setter with anything than exactly 1 parameter
        $params = $method->getParameters();
        if (count($params) !== 1) {
            return null;
        }
        $param = reset($params);

        // Get a field from annotation, or an empty one
        /** @var Input $field */
        $field = $this->getAnnotationReader()->getMethodAnnotation($method, Input::class) ?? new Input();

        if (!$field->getTypeInstance()) {
            $this->convertTypeDeclarationsToInstances($method, $field);
            $this->completeField($field, $method, $param);
        }

        return $field->toArray();
    }
1165095
public function handler($handler)
    {
        if ($this->formDtoMappingCallback) {
            if (!($handler instanceof IParameterizedActionHandler)) {
                list($handler, $parameterDtoType) = $this->wrapArrayParameterAsDto($handler);
                $handler = new CustomParameterizedActionHandler($handler, $this->returnDtoType, $parameterDtoType);
            }

            /** @var IStagedFormDtoMapping $mapping */
            $mapping = call_user_func($this->formDtoMappingCallback, $handler->getParameterTypeClass());

            call_user_func($this->callback, new ParameterizedAction(
                $this->name,
                $this->authSystem,
                $this->requiredPermissions,
                $mapping,
                $handler,
                $this->metadata
            ));
        } else {

            if (!($handler instanceof IUnparameterizedActionHandler)) {
                $handler = new CustomUnparameterizedActionHandler($handler, $this->returnDtoType);
            }

            call_user_func($this->callback, new UnparameterizedAction(
                $this->name,
                $this->authSystem,
                $this->requiredPermissions,
                $handler,
                $this->metadata
            ));
        }
    }
847496
public function defaultSettings()
    {
        $handler = $this->get('handler');
        if (class_exists($handler)) {
            $handler = new $handler();

            return $handler->defaultSettings($this);
        }

        return [];
    }
1061566
public function getInMethod(string $method): array
    {
        if (isset($this->methodIndex[$method])) {
            return $this->methodIndex[$method];
        }

        return [];
    }
131646
public function getAJAXTypeHandlers()
    {
        if ($this->ajaxTypeHandlers != null) {
            return $this->ajaxTypeHandlers;
        }

        $this->ajaxTypeHandlers = array();

        /** @noinspection PhpUndefinedFieldInspection */
        if (!$this->configFile->AJAXTypeHandlers->getName()) {
            return $this->ajaxTypeHandlers;
        }


        /** @noinspection PhpUndefinedFieldInspection */
        foreach ($this->configFile->AJAXTypeHandlers->class as $handler) {
            $class_array = array("class_name" => (string)$handler);
            if (isset($handler['link'])) {
                $class_array['link'] = $this->rootPath . "/" . $handler['link'];
            }
            $this->ajaxTypeHandlers[] = $class_array;
        }
        return $this->ajaxTypeHandlers;
    }
182053
protected function prepareHandler(HandlerInterface $handler, array $config = [])
    {
        if (! isset($config['formatter'])) {
            $handler->setFormatter($this->formatter());
        } elseif ($config['formatter'] !== 'default') {
            $handler->setFormatter($this->app->make($config['formatter'], $config['formatter_with'] ?? []));
        }

        return $handler;
    }
345532
public function configure($items, $handler)
    {
        if (!is_callable($handler)) {
            throw new \InvalidArgumentException(__METHOD__ . ' Handler should be callable.');
        }

        if (!$items instanceof \Traversable && !is_array($items)) {
            throw new \InvalidArgumentException(__METHOD__ . ' items should be array or iterator.');
        }

        foreach ($items as $key => $item) {
            call_user_func($handler, $this, $key, $item);
        }

        return $this;
    }
1086855
public function getCurlOption($method)
    {
        $curlOption = $this->config->getParamByKey('curlOption');
        if (isset($curlOption[$method]))
        {
            return $curlOption[$method];
        }
        else if (isset($curlOption['default']))
        {
            return $curlOption['default'];
        }

        return [];
    }