Skip to content

Commit dce9500

Browse files
committed
Convert config from XML to PHP
1 parent 8e520f8 commit dce9500

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

config/deploy_rsync.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file is part of the EcommitDeployRsyncBundle package.
7+
*
8+
* (c) E-commit <[email protected]>
9+
*
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
12+
*/
13+
14+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
15+
16+
use Ecommit\DeployRsyncBundle\Command\DeployRsyncCommand;
17+
18+
return static function (ContainerConfigurator $container): void {
19+
$container->services()
20+
21+
->set('ecommit_deploy_rsync.command.deploy_rsync', DeployRsyncCommand::class)
22+
->args([param('ecommit_deploy_rsync.environments'), param('ecommit_deploy_rsync.rsync'), param('kernel.project_dir')])
23+
->tag('console.command')
24+
;
25+
};

phpstan.neon.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ includes:
55
parameters:
66
level: max
77
paths:
8+
- config
89
- src
910
- tests

src/DependencyInjection/EcommitDeployRsyncExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Symfony\Component\Config\FileLocator;
1717
use Symfony\Component\DependencyInjection\ContainerBuilder;
1818
use Symfony\Component\DependencyInjection\Extension\Extension;
19-
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
19+
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
2020

2121
class EcommitDeployRsyncExtension extends Extension
2222
{
@@ -25,8 +25,8 @@ public function load(array $configs, ContainerBuilder $container): void
2525
$configuration = new Configuration();
2626
$config = $this->processConfiguration($configuration, $configs);
2727

28-
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../../config'));
29-
$loader->load('services.xml');
28+
$loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../../config'));
29+
$loader->load('deploy_rsync.php');
3030

3131
$container->setParameter('ecommit_deploy_rsync.environments', $config['environments']);
3232
$container->setParameter('ecommit_deploy_rsync.rsync', $config['rsync']);

0 commit comments

Comments
 (0)