src/Security/Security.php
protected function delegateToMultipleHandlers(array $handlers, $title, array $templates, callable $aggregator)
    {

        // Simpler case for a single authenticator
        if (count($handlers) === 1) {
            return $this->delegateToHandler(array_values($handlers)[0], $title, $templates);
        }

        // Process each of the handlers
        $results = array_map(
            function (RequestHandler $handler) {
                return $handler->handleRequest($this->getRequest());
            },
            $handlers
        );

        $response = call_user_func_array($aggregator, [$results]);
        // The return could be a HTTPResponse, in which we don't want to call the render
        if (is_array($response)) {
            return $this->renderWrappedController($title, $response, $templates);
        }

        return $response;
    }
protected function delegateToMultipleHandlers(array $handlers, $title, array $templates, callable $aggregator)
    {

        // Simpler case for a single authenticator
        if (count($handlers) === 1) {
            return $this->delegateToHandler(array_values($handlers)[0], $title, $templates);
        }

        // Process each of the handlers
        $results = array_map(
            function (RequestHandler $handler) {
                return $handler->handleRequest($this->getRequest());
            },
            $handlers
        );

        $response = call_user_func_array($aggregator, [$results]);
        // The return could be a HTTPResponse, in which we don't want to call the render
        if (is_array($response)) {
            return $this->renderWrappedController($title, $response, $templates);
        }

        return $response;
    }
protected function delegateToMultipleHandlers ( array $ handlers , $ title , array $ templates , callable $ aggregator ) { // Simpler case for a single authenticator if ( count ( $ handlers ) === 1 ) { return $ this -> delegateToHandler ( array_values ( $ handlers ) [ 0 ] , $ title , $ templates ) ; } // Process each of the handlers $ results = array_map ( function ( RequestHandler $ handler ) { return $ handler -> handleRequest ( $ this -> getRequest ( ) ) ; } , $ handlers ) ; $ response = call_user_func_array ( $ aggregator , [ $ results ] ) ; // The return could be a HTTPResponse, in which we don't want to call the render if ( is_array ( $ response ) ) { return $ this -> renderWrappedController ( $ title , $ response , $ templates ) ; } return $ response ; }
Delegate to a number of handlers and aggregate the results. This is used, for example, to
build the log-in page where there are multiple authenticators active.

If a single handler is passed, delegateToHandler() will be called instead

@param array|RequestHandler[] $handlers
@param string $title The title of the form
@param array $templates
@param callable $aggregator
@return array|HTTPResponse|RequestHandler|DBHTMLText|string
Delegate to a number of handlers and aggregate the results . This is used for example to build the log - in page where there are multiple authenticators active .