Skip to content

Commit f2d2c24

Browse files
committed
require symfony yaml
1 parent 7ca9e30 commit f2d2c24

File tree

5 files changed

+25
-24
lines changed

5 files changed

+25
-24
lines changed

composer.json

+14-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"symfony/console": "^6.1",
1010
"symfony/http-kernel": "^6.1",
1111
"symfony/dependency-injection": "^6.1",
12-
"symfony/config": "^6.1"
12+
"symfony/config": "^6.1",
13+
"symfony/yaml": "^6.1"
1314
},
1415
"license": "MIT",
1516
"autoload": {
@@ -31,5 +32,16 @@
3132
"email": "[email protected]"
3233
}
3334
],
34-
"minimum-stability": "dev"
35+
"minimum-stability": "dev",
36+
"scripts": {
37+
"md": [
38+
"phpmd src,tests ansi phpmd.xml.dist"
39+
],
40+
"cpd": [
41+
"phpcpd src"
42+
],
43+
"test": [
44+
"phpunit"
45+
]
46+
}
3547
}

src/DependencyInjection/DevgineDemoExtension.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
22

33
namespace Devgine\Demo\DependencyInjection;
44

5+
use Symfony\Component\Config\FileLocator;
56
use Symfony\Component\Console\Application;
67
use Symfony\Component\DependencyInjection\ContainerBuilder;
78
use Symfony\Component\DependencyInjection\Extension\Extension;
8-
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
9-
use Symfony\Component\Config\FileLocator;
9+
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
1010

1111
class DevgineDemoExtension extends Extension
1212
{
13+
/** @SuppressWarnings(PHPMD.UnusedFormalParameter) */
1314
public function load(array $configs, ContainerBuilder $container)
1415
{
15-
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
16+
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
1617

1718
if (class_exists(Application::class)) {
18-
$loader->load('console.xml');
19+
$loader->load('console.yaml');
1920
}
2021
}
2122
}

src/DevgineDemoBundle.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
namespace Devgine\Demo;
44

5-
use Symfony\Component\DependencyInjection\ContainerBuilder;
6-
use Symfony\Component\HttpKernel\Bundle\AbstractBundle;
5+
use Symfony\Component\HttpKernel\Bundle\Bundle;
76

8-
class DevgineDemoBundle extends AbstractBundle
7+
class DevgineDemoBundle extends Bundle
98
{
109
}

src/Resources/config/console.xml

-15
This file was deleted.

src/Resources/config/console.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
services:
2+
Devgine\Demo\Command\HelloCommand:
3+
tags:
4+
- { name: 'console.command', command: 'devgine:demo:hello' }

0 commit comments

Comments
 (0)