From 22c28bc70ff9e573cae7f95c0d5c9f6065aba811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Sat, 4 Nov 2017 17:01:01 +0000 Subject: [PATCH 1/4] Allow Symfony 4.0 --- .travis.yml | 3 +++ composer.json | 2 +- vendor-bin/symfony/composer.json | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 46f6e50e0..9d7bf0e2c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,9 +24,12 @@ matrix: env: SYMFONY_VERSION='~3.3.0' - php: '7.1' env: SYMFONY_VERSION='~3.4.0@dev' +- php: '7.1' + env: SYMFONY_VERSION='~4.0.0@dev' allow_failures: - php: nightly - env: SYMFONY_VERSION='~3.4.0@dev' + - env: SYMFONY_VERSION='~4.0.0@dev' before_install: - set -eo pipefail diff --git a/composer.json b/composer.json index 6ce698d47..fbe6eda22 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "phpspec/prophecy": "^1.6", "phpunit/phpunit": "^6.0", "symfony/phpunit-bridge": "^3.3 || ^4.0", - "symfony/var-dumper": "^3.2" + "symfony/var-dumper": "^3.2 || ^4.0" }, "autoload": { diff --git a/vendor-bin/symfony/composer.json b/vendor-bin/symfony/composer.json index 3b67ac8f0..7f9956810 100644 --- a/vendor-bin/symfony/composer.json +++ b/vendor-bin/symfony/composer.json @@ -1,6 +1,6 @@ { "require-dev": { - "symfony/symfony": "^3.1", + "symfony/symfony": "^3.3 || ^4.0", "theofidry/composer-inheritance-plugin": "^1.0" }, "config": { From e9b8cc4052c497aca4b997f60e9d4b9d1e1c5126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Sat, 4 Nov 2017 17:58:39 +0000 Subject: [PATCH 2/4] Fix tests --- .../Bridge/Symfony/Application/AppKernel.php | 25 ++++++++++++++++++- .../Bridge/Symfony/Application/config.yml | 1 - .../Symfony/Application/config_custom.yml | 1 - 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/fixtures/Bridge/Symfony/Application/AppKernel.php b/fixtures/Bridge/Symfony/Application/AppKernel.php index 68928d8ff..bdef74286 100644 --- a/fixtures/Bridge/Symfony/Application/AppKernel.php +++ b/fixtures/Bridge/Symfony/Application/AppKernel.php @@ -16,6 +16,10 @@ use Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Component\Config\Loader\LoaderInterface; +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\Compiler\PassConfig; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\HttpKernel\Kernel; class AppKernel extends Kernel @@ -45,7 +49,7 @@ public function registerBundles() } /** - * {@inheritdoc} + * @inheritdoc */ public function registerContainerConfiguration(LoaderInterface $loader) { @@ -54,6 +58,25 @@ public function registerContainerConfiguration(LoaderInterface $loader) $loader->load($config); } + /** + * @inheritdoc + */ + public function build(ContainerBuilder $container) + { + $container->addCompilerPass(new class implements CompilerPassInterface { + public function process(ContainerBuilder $container) + { + foreach ($container->getDefinitions() as $id => $definition) { + if ('nelmio_alice' !== substr($id, 0, 12)) { + continue; + } + + $definition->setPublic(true); + } + } + }, PassConfig::TYPE_AFTER_REMOVING); + } + public function setConfigurationResource(string $resource) { $this->config = $resource; diff --git a/fixtures/Bridge/Symfony/Application/config.yml b/fixtures/Bridge/Symfony/Application/config.yml index 2fb2b7003..7cb1c4a8d 100644 --- a/fixtures/Bridge/Symfony/Application/config.yml +++ b/fixtures/Bridge/Symfony/Application/config.yml @@ -12,7 +12,6 @@ framework: router: resource: ~ strict_requirements: '%kernel.debug%' - trusted_proxies: ~ test: ~ session: storage_id: session.storage.mock_file diff --git a/fixtures/Bridge/Symfony/Application/config_custom.yml b/fixtures/Bridge/Symfony/Application/config_custom.yml index ce245d934..2ac49a911 100644 --- a/fixtures/Bridge/Symfony/Application/config_custom.yml +++ b/fixtures/Bridge/Symfony/Application/config_custom.yml @@ -12,7 +12,6 @@ framework: router: resource: ~ strict_requirements: '%kernel.debug%' - trusted_proxies: ~ test: ~ session: storage_id: session.storage.mock_file From e7bb244ce5389a74ba0904abcbabdb6509d2420b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Sat, 4 Nov 2017 18:23:18 +0000 Subject: [PATCH 3/4] Fix --- fixtures/Bridge/Symfony/Application/AppKernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fixtures/Bridge/Symfony/Application/AppKernel.php b/fixtures/Bridge/Symfony/Application/AppKernel.php index bdef74286..70d6d151a 100644 --- a/fixtures/Bridge/Symfony/Application/AppKernel.php +++ b/fixtures/Bridge/Symfony/Application/AppKernel.php @@ -67,14 +67,14 @@ public function build(ContainerBuilder $container) public function process(ContainerBuilder $container) { foreach ($container->getDefinitions() as $id => $definition) { - if ('nelmio_alice' !== substr($id, 0, 12)) { - continue; - } + $definition->setPublic(true); + } + foreach ($container->getAliases() as $id => $definition) { $definition->setPublic(true); } } - }, PassConfig::TYPE_AFTER_REMOVING); + }, PassConfig::TYPE_OPTIMIZE); } public function setConfigurationResource(string $resource) From 9b281f91c02a4060559cdc67dd656e2ea7aff7ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Sat, 4 Nov 2017 18:24:15 +0000 Subject: [PATCH 4/4] Fix travis confgi --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9d7bf0e2c..8b610d76f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ matrix: env: SYMFONY_VERSION='~3.3.0' - php: '7.1' env: SYMFONY_VERSION='~3.4.0@dev' -- php: '7.1' + - php: '7.1' env: SYMFONY_VERSION='~4.0.0@dev' allow_failures: - php: nightly