Created the console application via a factory

This commit is contained in:
Alejandro Celaya
2016-07-05 23:25:39 +02:00
parent 9ce5e255f1
commit 96478f3400
6 changed files with 64 additions and 14 deletions

View File

@@ -1,16 +1,10 @@
#!/usr/bin/env php
<?php
use Acelaya\UrlShortener\CliCommands\GenerateShortcodeCommand;
use Acelaya\UrlShortener\CliCommands\ResolveUrlCommand;
use Interop\Container\ContainerInterface;
use Symfony\Component\Console\Application as CliApp;
/** @var ContainerInterface $container */
$container = include __DIR__ . '/../config/container.php';
$app = new CliApp();
$app->addCommands([
$container->get(GenerateShortcodeCommand::class),
$container->get(ResolveUrlCommand::class),
]);
$app = $container->get(CliApp::class);
$app->run();