public static function resolve(array $controllers)
    {
        $callbacks = [];

        foreach ($controllers as $controller) {
            $qualifiedController = '\\' . trim($controller, '\\');

            $callbacks[$controller] = function (ContainerInterface $container) use ($qualifiedController) {
                $controller = new $qualifiedController();

                if ($controller instanceof Controller) {
                    $controller->setContainer($container);
                }

                return $controller;
            };
        }

        return $callbacks;
    }
public static function resolve(array $controllers)
    {
        $callbacks = [];

        foreach ($controllers as $controller) {
            $qualifiedController = '\\' . trim($controller, '\\');

            $callbacks[$controller] = function (ContainerInterface $container) use ($qualifiedController) {
                $controller = new $qualifiedController();

                if ($controller instanceof Controller) {
                    $controller->setContainer($container);
                }

                return $controller;
            };
        }

        return $callbacks;
    }
public static function resolve ( array $ controllers ) { $ callbacks = [ ] ; foreach ( $ controllers as $ controller ) { $ qualifiedController = '\\' . trim ( $ controller , '\\' ) ; $ callbacks [ $ controller ] = function ( ContainerInterface $ container ) use ( $ qualifiedController ) { $ controller = new $ qualifiedController ( ) ; if ( $ controller instanceof Controller ) { $ controller -> setContainer ( $ container ) ; } return $ controller ; } ; } return $ callbacks ; }
Create service callbacks.

@param array $controllers

@return array
Create service callbacks .