Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Symfony 4.0 support #834

Merged
merged 4 commits into from
Nov 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
25 changes: 24 additions & 1 deletion fixtures/Bridge/Symfony/Application/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -45,7 +49,7 @@ public function registerBundles()
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function registerContainerConfiguration(LoaderInterface $loader)
{
Expand All @@ -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) {
$definition->setPublic(true);
}

foreach ($container->getAliases() as $id => $definition) {
$definition->setPublic(true);
}
}
}, PassConfig::TYPE_OPTIMIZE);
}

public function setConfigurationResource(string $resource)
{
$this->config = $resource;
Expand Down
1 change: 0 additions & 1 deletion fixtures/Bridge/Symfony/Application/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ framework:
router:
resource: ~
strict_requirements: '%kernel.debug%'
trusted_proxies: ~
test: ~
session:
storage_id: session.storage.mock_file
Expand Down
1 change: 0 additions & 1 deletion fixtures/Bridge/Symfony/Application/config_custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ framework:
router:
resource: ~
strict_requirements: '%kernel.debug%'
trusted_proxies: ~
test: ~
session:
storage_id: session.storage.mock_file
Expand Down
2 changes: 1 addition & 1 deletion vendor-bin/symfony/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require-dev": {
"symfony/symfony": "^3.1",
"symfony/symfony": "^3.3 || ^4.0",
"theofidry/composer-inheritance-plugin": "^1.0"
},
"config": {
Expand Down