<?php


namespace ZeffMu;

use ZeffMu\App;
use Zend\ModuleManager\Feature\ServiceProviderInterface;
use Zend\Mvc\Router\Http\TreeRouteStack as HttpRouter;
use Zend\ServiceManager\ServiceLocatorInterface;

class Module implements ServiceProviderInterface
{
    /**
     * {@inheritDoc}
     */
    public function getServiceConfig()
    {
        return array(
            'factories' => array(
                'Application' => function (ServiceLocatorInterface $sl) {
                    return new App($sl->get('Config'), $sl);
                },
                'Router'      => function () {
                    return HttpRouter::factory(array());
                },
                'HttpRouter'  => function (ServiceLocatorInterface $sl) {
                    return $sl->get('Router');
                }
            ),
        );
    }
}
