Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
switch to php service definition
Browse files Browse the repository at this point in the history
  • Loading branch information
mloberg committed Aug 23, 2020
1 parent a739342 commit c2c3581
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
6 changes: 3 additions & 3 deletions DependencyInjection/MloConsoleExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

final class MloConsoleExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
$loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.php');

$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
Expand Down
18 changes: 18 additions & 0 deletions Resources/config/services.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Mlo\ConsoleBundle\Command\ConsoleCommand;
use Psy\Shell;

return static function (ContainerConfigurator $container) {
$container->services()
->set('mlo_console.shell', Shell::class)

->set('mlo_console.command', ConsoleCommand::class)
->args([
service('mlo_console.shell'),
])
->tag('console.command', ['command' => 'tinker'])
;
};
17 changes: 0 additions & 17 deletions Resources/config/services.xml

This file was deleted.

0 comments on commit c2c3581

Please sign in to comment.