To config Dependency Injection Container place your dependencies in section container in the config.yml.
To define simple service in container:
request:
class: 'Hiro\Request'
To inject defined service use the calls parameter:
router:
class: 'Hiro\Router'
calls: ['request']
To inject simple type use the arguments parameter:
db:
class: 'Hiro\Db'
arguments: ['sqlite:///tmp/db.sqlite']
$serviceContainer->router->addRoute('get', '/hello-world', function() {
$currentUri = $this->request->getCurrentUri();
$content = 'Hello World!';
return new Hiro\Response($content);
});