Skip to content

Commit

Permalink
require symfony yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
yosrib committed May 24, 2023
1 parent 7ca9e30 commit f2d2c24
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 24 deletions.
16 changes: 14 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"symfony/console": "^6.1",
"symfony/http-kernel": "^6.1",
"symfony/dependency-injection": "^6.1",
"symfony/config": "^6.1"
"symfony/config": "^6.1",
"symfony/yaml": "^6.1"
},
"license": "MIT",
"autoload": {
Expand All @@ -31,5 +32,16 @@
"email": "yosribahri@gmail.com"
}
],
"minimum-stability": "dev"
"minimum-stability": "dev",
"scripts": {
"md": [
"phpmd src,tests ansi phpmd.xml.dist"
],
"cpd": [
"phpcpd src"
],
"test": [
"phpunit"
]
}
}
9 changes: 5 additions & 4 deletions src/DependencyInjection/DevgineDemoExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@

namespace Devgine\Demo\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;

class DevgineDemoExtension extends Extension
{
/** @SuppressWarnings(PHPMD.UnusedFormalParameter) */
public function load(array $configs, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));

if (class_exists(Application::class)) {
$loader->load('console.xml');
$loader->load('console.yaml');
}
}
}
5 changes: 2 additions & 3 deletions src/DevgineDemoBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

namespace Devgine\Demo;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\AbstractBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;

class DevgineDemoBundle extends AbstractBundle
class DevgineDemoBundle extends Bundle
{
}
15 changes: 0 additions & 15 deletions src/Resources/config/console.xml

This file was deleted.

4 changes: 4 additions & 0 deletions src/Resources/config/console.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
services:
Devgine\Demo\Command\HelloCommand:
tags:
- { name: 'console.command', command: 'devgine:demo:hello' }

0 comments on commit f2d2c24

Please sign in to comment.