src/App.php
public function registerService($service, $class)
    {
        $this[$service] = function ($app) use ($class) {
                $inst = new $class;
                if ($inst instanceof FactoryInterface) {
                    return $inst->create($app);
                } else {
                    return $inst;
                }
            };
    }
public function registerService($service, $class)
    {
        $this[$service] = function ($app) use ($class) {
                $inst = new $class;
                if ($inst instanceof FactoryInterface) {
                    return $inst->create($app);
                } else {
                    return $inst;
                }
            };
    }
public function registerService ( $ service , $ class ) { $ this [ $ service ] = function ( $ app ) use ( $ class ) { $ inst = new $ class ; if ( $ inst instanceof FactoryInterface ) { return $ inst -> create ( $ app ) ; } else { return $ inst ; } } ; }
Register a Service to the DI container.
Services are singletons, and the same instance
is returned every time the identifier is requested

@param string $service identifier
@param string $class   Class to create
Register a Service to the DI container . Services are singletons and the same instance is returned every time the identifier is requested