Skip to content

Commit 1cada24

Browse files
committed
Merge branch '4.0'
* 4.0: [HttpKernel] Better handling of legacy cache modify definitions only if the do exist [DI] Prevent a ReflectionException during cache:clear when the parent class doesn't exist [FrameworkBundle] Make MicroKernelTraitTest green don't override existing verbosity env var [HttpKernel] Read $_ENV when checking SHELL_VERBOSITY Remove unreachable code bumped Symfony version to 4.0.0 Automatically enable the CSRF protection if CSRF manager exists updated VERSION for 4.0.0-RC2 updated CHANGELOG for 4.0.0-RC2 bumped Symfony version to 3.4.0 adding checks for the expression language updated VERSION for 3.4.0-RC2 updated CHANGELOG for 3.4.0-RC2
2 parents 22192b1 + d2496ab commit 1cada24

File tree

13 files changed

+66
-16
lines changed

13 files changed

+66
-16
lines changed

CHANGELOG-4.0.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ in 4.0 minor versions.
77
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
88
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v4.0.0...v4.0.1
99

10+
* 4.0.0-RC2 (2017-11-24)
11+
12+
* bug #25146 [DI] Dont resolve envs in service ids (nicolas-grekas)
13+
* bug #25113 [Routing] Fix "config-file-relative" annotation loader resources (nicolas-grekas, sroze)
14+
* bug #25065 [FrameworkBundle] Update translation commands to work with default paths (yceruto)
15+
* bug #25109 Make debug:container search command case-insensitive (jzawadzki)
16+
* bug #25121 [FrameworkBundle] Fix AssetsInstallCommand (nicolas-grekas)
17+
* bug #25102 [Form] Fixed ContextErrorException in FileType (chihiro-adachi)
18+
* bug #25130 [DI] Fix handling of inlined definitions by ContainerBuilder (nicolas-grekas)
19+
* bug #25119 [DI] Fix infinite loop when analyzing references (nicolas-grekas)
20+
* bug #25094 [FrameworkBundle][DX] Display a nice error message if an enabled component is missing (derrabus)
21+
* bug #25100 [SecurityBundle] providerIds is undefined error when firewall provider is not specified (karser)
22+
* bug #25100 [SecurityBundle] providerIds is undefined error when firewall provider is not specified (karser)
23+
* bug #25100 [SecurityBundle] providerIds is undefined error when firewall provider is not specified (karser)
24+
* bug #25097 [Bridge\PhpUnit] Turn "preserveGlobalState" to false by default, revert "Blacklist" removal (nicolas-grekas)
25+
1026
* 4.0.0-RC1 (2017-11-21)
1127

1228
* bug #25077 [Bridge/Twig] Let getFlashes starts the session (MatTheCat)

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Symfony\Component\Form\Form;
2222
use Symfony\Component\Lock\Lock;
2323
use Symfony\Component\Lock\Store\SemaphoreStore;
24+
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
2425
use Symfony\Component\Serializer\Serializer;
2526
use Symfony\Component\Translation\Translator;
2627
use Symfony\Component\Validator\Validation;
@@ -109,7 +110,7 @@ private function addCsrfSection(ArrayNodeDefinition $rootNode)
109110
$rootNode
110111
->children()
111112
->arrayNode('csrf_protection')
112-
->canBeEnabled()
113+
->{!class_exists(FullStack::class) && class_exists(CsrfTokenManagerInterface::class) ? 'canBeDisabled' : 'canBeEnabled'}()
113114
->end()
114115
->end()
115116
;

src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/MicroKernelTraitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class MicroKernelTraitTest extends TestCase
1818
{
1919
public function test()
2020
{
21-
$kernel = new ConcreteMicroKernel('test', true);
21+
$kernel = new ConcreteMicroKernel('test', false);
2222
$kernel->boot();
2323

2424
$request = Request::create('/');
@@ -31,7 +31,7 @@ public function test()
3131

3232
public function testAsEventSubscriber()
3333
{
34-
$kernel = new ConcreteMicroKernel('test', true);
34+
$kernel = new ConcreteMicroKernel('test', false);
3535
$kernel->boot();
3636

3737
$request = Request::create('/danger');

src/Symfony/Component/DependencyInjection/Compiler/RegisterServiceSubscribersPass.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ protected function processValue($value, $isRoot = false)
7474
if ($optionalBehavior = '?' === $type[0]) {
7575
$type = substr($type, 1);
7676
$optionalBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE;
77-
} elseif ($optionalBehavior = '!' === $type[0]) {
78-
$type = substr($type, 1);
79-
$optionalBehavior = ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE;
8077
}
8178
if (is_int($key)) {
8279
$key = $type;

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ private function collectLineage($class, array &$lineage)
375375
if (isset($lineage[$class])) {
376376
return;
377377
}
378-
if (!$r = $this->container->getReflectionClass($class)) {
378+
if (!$r = $this->container->getReflectionClass($class, false)) {
379379
return;
380380
}
381381
if ($this->container instanceof $class) {

src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,10 @@ private function getArgumentsAsPhp(\DOMElement $node, $name, $file, $lowercase =
488488
$arguments[$key] = new Reference($arg->getAttribute('id'), $invalidBehavior);
489489
break;
490490
case 'expression':
491+
if (!class_exists(Expression::class)) {
492+
throw new \LogicException(sprintf('The type="expression" attribute cannot be used without the ExpressionLanguage component. Try running "composer require symfony/expression-language".'));
493+
}
494+
491495
$arguments[$key] = new Expression($arg->nodeValue);
492496
break;
493497
case 'collection':

src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,10 @@ private function resolveServices($value, $file, $isParameter = false)
727727
$value[$k] = $this->resolveServices($v, $file, $isParameter);
728728
}
729729
} elseif (is_string($value) && 0 === strpos($value, '@=')) {
730+
if (!class_exists(Expression::class)) {
731+
throw new \LogicException(sprintf('The "@=" expression syntax cannot be used without the ExpressionLanguage component. Try running "composer require symfony/expression-language".'));
732+
}
733+
730734
return new Expression(substr($value, 2));
731735
} elseif (is_string($value) && 0 === strpos($value, '@')) {
732736
if (0 === strpos($value, '@@')) {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Symfony\Component\DependencyInjection\Tests\Fixtures;
4+
5+
class ParentNotExists extends \NotExists
6+
{
7+
}

src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container_inline_requires.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
88
use Symfony\Component\DependencyInjection\Reference;
99
use Symfony\Component\DependencyInjection\Tests\Fixtures\includes\HotPath;
10+
use Symfony\Component\DependencyInjection\Tests\Fixtures\ParentNotExists;
1011

1112
$container = new ContainerBuilder();
1213

1314
$container->register(HotPath\C1::class)->addTag('container.hot_path')->setPublic(true);
1415
$container->register(HotPath\C2::class)->addArgument(new Reference(HotPath\C3::class))->setPublic(true);
1516
$container->register(HotPath\C3::class);
17+
$container->register(ParentNotExists::class)->setPublic(true);
1618

1719
return $container;

src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_inline_requires.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public function __construct()
3030

3131
$this->services = $this->privates = array();
3232
$this->methodMap = array(
33+
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\ParentNotExists' => 'getParentNotExistsService',
3334
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\includes\\HotPath\\C1' => 'getC1Service',
3435
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\includes\\HotPath\\C2' => 'getC2Service',
3536
);
@@ -67,6 +68,16 @@ public function getRemovedIds()
6768
);
6869
}
6970

71+
/**
72+
* Gets the public 'Symfony\Component\DependencyInjection\Tests\Fixtures\ParentNotExists' shared service.
73+
*
74+
* @return \Symfony\Component\DependencyInjection\Tests\Fixtures\ParentNotExists
75+
*/
76+
protected function getParentNotExistsService()
77+
{
78+
return $this->services['Symfony\Component\DependencyInjection\Tests\Fixtures\ParentNotExists'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\ParentNotExists();
79+
}
80+
7081
/**
7182
* Gets the public 'Symfony\Component\DependencyInjection\Tests\Fixtures\includes\HotPath\C1' shared service.
7283
*

0 commit comments

Comments
 (0)