Skip to content

Commit

Permalink
avoid deprecation notices during tests with Symfony 3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
craue committed Dec 29, 2017
1 parent b292d6b commit ea77d42
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
23 changes: 21 additions & 2 deletions DependencyInjection/CraueFormFlowDemoExtension.php
Expand Up @@ -4,8 +4,10 @@

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\HttpKernel\Kernel;

/**
* Registration of the extension via DI.
Expand All @@ -14,7 +16,7 @@
* @copyright 2013-2017 Christian Raue
* @license http://opensource.org/licenses/mit-license.php MIT License
*/
class CraueFormFlowDemoExtension extends Extension {
class CraueFormFlowDemoExtension extends Extension implements PrependExtensionInterface {

/**
* {@inheritDoc}
Expand All @@ -26,4 +28,21 @@ public function load(array $config, ContainerBuilder $container) {
$loader->load('twig.xml');
}

/**
* {@inheritDoc}
*/
public function prepend(ContainerBuilder $container) {
// avoid a deprecation notice regarding logout_on_user_change with Symfony 3.4
// TODO remove as soon as Symfony >= 4.0 is required
if (Kernel::MAJOR_VERSION === 3 && Kernel::MINOR_VERSION === 4) {
$container->prependExtensionConfig('security', array(
'firewalls' => array(
'dummy' => array(
'logout_on_user_change' => true,
),
),
));
}
}

}
4 changes: 4 additions & 0 deletions Resources/config/form_flow.xml
Expand Up @@ -11,21 +11,25 @@
<services>
<service id="craueFormFlowDemoBundle.form.flow.createTopic"
class="Craue\FormFlowDemoBundle\Form\CreateTopicFlow"
public="true"
parent="craue.form.flow">
</service>

<service id="craueFormFlowDemoBundle.form.flow.createLocation"
class="Craue\FormFlowDemoBundle\Form\CreateLocationFlow"
public="true"
parent="craue.form.flow">
</service>

<service id="craueFormFlowDemoBundle.form.flow.createVehicle"
class="Craue\FormFlowDemoBundle\Form\CreateVehicleFlow"
public="true"
parent="craue.form.flow">
</service>

<service id="craueFormFlowDemoBundle.form.flow.photoUpload"
class="Craue\FormFlowDemoBundle\Form\PhotoUploadFlow"
public="true"
parent="craue.form.flow">
</service>
</services>
Expand Down

0 comments on commit ea77d42

Please sign in to comment.