Skip to content

Commit c3e38e2

Browse files
committed
Convert IntegrationTestBundle config to PHP
1 parent c6321b9 commit c3e38e2

12 files changed

Lines changed: 67 additions & 72 deletions

Tests/IntegrationTestBundle/DependencyInjection/Compiler/DoctrineStorageCompilerPass.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Symfony\Component\Config\FileLocator;
66
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
77
use Symfony\Component\DependencyInjection\ContainerBuilder;
8+
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
89
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
910

1011
/**
@@ -18,8 +19,8 @@ class DoctrineStorageCompilerPass implements CompilerPassInterface {
1819

1920
public function process(ContainerBuilder $container) : void {
2021
if ($container->has('doctrine.dbal.default_connection')) {
21-
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../../Resources/config'));
22-
$loader->load('doctrine_storage.xml');
22+
$loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../../Resources/config'));
23+
$loader->load('doctrine_storage.php');
2324
}
2425
}
2526

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
4+
5+
return static function (ContainerConfigurator $container) {
6+
$services = $container->services();
7+
$parameters = $container->parameters();
8+
9+
$services->load('Craue\\FormFlowBundle\\Tests\\IntegrationTestBundle\\Controller\\', '../../Controller/*')
10+
->autowire()
11+
->autoconfigure();
12+
};

Tests/IntegrationTestBundle/Resources/config/controller.xml

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
4+
5+
return static function (ContainerConfigurator $container) {
6+
$services = $container->services();
7+
$parameters = $container->parameters();
8+
9+
$services->set('craue.form.flow.storageKeyGenerator', \Craue\FormFlowBundle\Storage\UserSessionStorageKeyGenerator::class)
10+
->args([
11+
service('security.token_storage'),
12+
service('request_stack'),
13+
]);
14+
15+
$services->set('craue.form.flow.storage.doctrine', \Craue\FormFlowBundle\Storage\DoctrineStorage::class)
16+
->private()
17+
->args([
18+
service('doctrine.dbal.default_connection'),
19+
service('craue.form.flow.storageKeyGenerator'),
20+
]);
21+
22+
$services->alias('craue.form.flow.storage', 'craue.form.flow.storage.doctrine')
23+
->public();
24+
};

Tests/IntegrationTestBundle/Resources/config/doctrine_storage.xml

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
4+
5+
return static function (ContainerConfigurator $container) {
6+
$services = $container->services();
7+
$parameters = $container->parameters();
8+
9+
$services->load('Craue\\FormFlowBundle\\Tests\\IntegrationTestBundle\\Form\\', '../../Form/*')
10+
->public()
11+
->autoconfigure();
12+
};

Tests/IntegrationTestBundle/Resources/config/form_flow_with_autoconfiguration.xml

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
4+
5+
return static function (ContainerConfigurator $container) {
6+
$services = $container->services();
7+
$parameters = $container->parameters();
8+
9+
$services->load('Craue\\FormFlowBundle\\Tests\\IntegrationTestBundle\\Form\\', '../../Form/*')
10+
->parent('craue.form.flow')
11+
->public();
12+
};

Tests/IntegrationTestBundle/Resources/config/form_flow_with_parent_service.xml

Lines changed: 0 additions & 14 deletions
This file was deleted.

Tests/config/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
imports:
2-
- { resource: '@CraueFormFlowBundle/Resources/config/form_flow.xml' }
3-
- { resource: '@IntegrationTestBundle/Resources/config/controller.xml' }
2+
- { resource: '@CraueFormFlowBundle/Resources/config/form_flow.php' }
3+
- { resource: '@IntegrationTestBundle/Resources/config/controller.php' }
44
- { resource: config_hacks.php }
55

66
framework:

0 commit comments

Comments
 (0)