mirror of
https://github.com/opdavies/gmail-filter-builder.git
synced 2025-01-22 12:07:32 +00:00
Use class names for service names
This commit is contained in:
parent
0779825f80
commit
685fbe5188
|
@ -13,6 +13,6 @@ if (file_exists(__DIR__.'/../vendor/autoload.php')) {
|
|||
$container = new Container();
|
||||
|
||||
/** @var Application $application */
|
||||
$application = $container->get('app.cli');
|
||||
$application = $container->get(Application::class);
|
||||
$application->setDefaultCommand(GenerateCommand::NAME);
|
||||
$application->run();
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
services:
|
||||
app.cli:
|
||||
class: Symfony\Component\Console\Application
|
||||
Symfony\Component\Console\Application:
|
||||
autowire: true
|
||||
|
||||
app.builder:
|
||||
class: Opdavies\GmailFilterBuilder\Service\Builder
|
||||
|
||||
app.generate.command:
|
||||
class: Opdavies\GmailFilterBuilder\Console\Command\GenerateCommand
|
||||
Opdavies\GmailFilterBuilder\Console\Command\GenerateCommand:
|
||||
autowire: true
|
||||
tags:
|
||||
- { name: ConsoleCommand }
|
||||
|
|
|
@ -38,6 +38,7 @@ class GenerateCommand extends Command
|
|||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
try {
|
||||
// TODO: Inject this.
|
||||
new Builder($this->filters($input), $outputFile = $this->outputFile($input));
|
||||
|
||||
$io->success(sprintf('%s file generated.', $outputFile));
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Opdavies\GmailFilterBuilder\Container;
|
||||
|
||||
use Symfony\Component\Console\Application;
|
||||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
|
@ -13,7 +14,7 @@ class CommandCompilerClass implements CompilerPassInterface
|
|||
*/
|
||||
public function process(ContainerBuilder $container)
|
||||
{
|
||||
$definition = $container->findDefinition('app.cli');
|
||||
$definition = $container->findDefinition(Application::class);
|
||||
$taggedServices = $container->findTaggedServiceIds('ConsoleCommand');
|
||||
|
||||
foreach ($taggedServices as $id => $tags) {
|
||||
|
|
Loading…
Reference in a new issue