Skip to content

Commit 201b472

Browse files
Merge branch '4.1'
* 4.1: (26 commits) Revert "bug #27312 Supress deprecation notices thrown when getting private servies from container in tests (arderyp)" [HttpKernel] reset kernel start time on reboot Add code of Conduct links in our README bumped Symfony version to 4.0.12 [FrameworkBundle] Fix using test.service_container when Client is rebooted [DI] never inline lazy services updated VERSION for 4.0.11 updated CHANGELOG for 4.0.11 bumped Symfony version to 3.4.12 updated VERSION for 3.4.11 updated CHANGELOG for 3.4.11 Default testsuite to latest PHPUnit 6.* [Github] Update the pull-request template bumped Symfony version to 2.8.42 updated VERSION for 2.8.41 updated CHANGELOG for 2.8.41 Tweak Argon2 test config [HttpFoundation] Fix cookie test with xdebug [FrameworkBundle] cleanup generated test container [Serializer] Check the value of enable_max_depth if defined ...
2 parents d314735 + d4d137d commit 201b472

File tree

36 files changed

+218
-103
lines changed

36 files changed

+218
-103
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
| Q | A
22
| ------------- | ---
3-
| Branch? | master for features / 2.7 up to 4.0 for bug fixes <!-- see below -->
3+
| Branch? | master for features / 2.8 up to 4.1 for bug fixes <!-- see below -->
44
| Bug fix? | yes/no
55
| New feature? | yes/no <!-- don't forget to update src/**/CHANGELOG.md files -->
66
| BC breaks? | no <!-- see https://symfony.com/bc -->

CHANGELOG-4.0.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ 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.11 (2018-05-25)
11+
12+
* bug #27364 [DI] Fix bad exception on uninitialized references to non-shared services (nicolas-grekas)
13+
* bug #27359 [HttpFoundation] Fix perf issue during MimeTypeGuesser intialization (nicolas-grekas)
14+
* security #cve-2018-11408 [SecurityBundle] Fail if security.http_utils cannot be configured
15+
* security #cve-2018-11406 clear CSRF tokens when the user is logged out
16+
* security #cve-2018-11385 migrating session for UsernamePasswordJsonAuthenticationListener
17+
* security #cve-2018-11385 Adding session authentication strategy to Guard to avoid session fixation
18+
* security #cve-2018-11385 Adding session strategy to ALL listeners to avoid *any* possible fixation
19+
* security #cve-2018-11386 [HttpFoundation] Break infinite loop in PdoSessionHandler when MySQL is in loose mode
20+
* bug #27341 [WebProfilerBundle] Fixed validator/dump trace CSS (yceruto)
21+
* bug #27337 [FrameworkBundle] fix typo in CacheClearCommand (emilielorenzo)
22+
1023
* 4.0.10 (2018-05-21)
1124

1225
* bug #27264 [Validator] Use strict type in URL validator (mimol91)

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Community
2929
* [Join the Symfony Community][11] and meet other members at the [Symfony events][12].
3030
* [Get Symfony support][13] on Stack Overflow, Slack, IRC, etc.
3131
* Follow us on [GitHub][14], [Twitter][15] and [Facebook][16].
32+
* Read our [Code of Conduct][24] and meet the [CARE Team][25]
3233

3334
Contributing
3435
------------
@@ -71,3 +72,5 @@ Symfony development is sponsored by [SensioLabs][21], led by the
7172
[21]: https://sensiolabs.com
7273
[22]: https://symfony.com/doc/current/contributing/code/core_team.html
7374
[23]: https://github.com/symfony/symfony-demo
75+
[24]: https://symfony.com/coc
76+
[25]: https://symfony.com/doc/current/contributing/code_of_conduct/care_team.html

phpunit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if (!file_exists(__DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) {
88
exit(1);
99
}
1010
if (\PHP_VERSION_ID >= 70000 && !getenv('SYMFONY_PHPUNIT_VERSION')) {
11-
putenv('SYMFONY_PHPUNIT_VERSION=6.0');
11+
putenv('SYMFONY_PHPUNIT_VERSION=6.5');
1212
}
1313
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
1414
require __DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit';

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -109,30 +109,6 @@ public static function register($mode = 0)
109109
}
110110

111111
$trace = debug_backtrace(true);
112-
113-
// Silence deprecation warnings about private service accessed
114-
// from the service container if done so from a Test class.
115-
// As of Symfony 4.1, there is a new TestContainer that allows
116-
// fetching of private services within tests, so we no longer
117-
// need to warn about this behavior.
118-
//
119-
// NOTE: the event at the top of the stack $trace (index 0) should
120-
// always be the PhpUnitBridge's DeprecationErrorHandler; the
121-
// second event (index 1) should be the trigger_error() event;
122-
// the third event (index 2) should be the actual source of the
123-
// triggered deprecation notice; and the fourth event (index 3)
124-
// represents the action that called the deprecated code. In the
125-
// scenario that we want to suppress, the 4th event will be an
126-
// object instance of \PHPUnit\Framework\TestCase.
127-
if (isset($trace[3]['object'])) {
128-
$isPrivateServiceNotice = false !== strpos($msg, ' service is private, ');
129-
$isNoticeForContainerGetHasUsage = 'Symfony\Component\DependencyInjection\Container' === $trace[2]['class'] && in_array($trace[2]['function'], array('get', 'has'));
130-
$noticeWasTriggeredByPhpUnitTest = $trace[3]['object'] instanceof \PHPUnit\Framework\TestCase;
131-
if ($isPrivateServiceNotice && $isNoticeForContainerGetHasUsage && $noticeWasTriggeredByPhpUnitTest) {
132-
return false;
133-
}
134-
}
135-
136112
$group = 'other';
137113
$isVendor = DeprecationErrorHandler::MODE_WEAK_VENDORS === $mode && $inVendors($file);
138114

src/Symfony/Bridge/PhpUnit/Tests/CoverageListenerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ public function test()
2727
$dir = __DIR__.'/../Tests/Fixtures/coverage';
2828
$phpunit = $_SERVER['argv'][0];
2929

30-
exec("$php $phpunit -c $dir/phpunit-without-listener.xml.dist $dir/tests/ --coverage-text", $output);
30+
exec("$php $phpunit -c $dir/phpunit-without-listener.xml.dist $dir/tests/ --coverage-text 2> /dev/null", $output);
3131
$output = implode("\n", $output);
3232
$this->assertContains('FooCov', $output);
3333

34-
exec("$php $phpunit -c $dir/phpunit-with-listener.xml.dist $dir/tests/ --coverage-text", $output);
34+
exec("$php $phpunit -c $dir/phpunit-with-listener.xml.dist $dir/tests/ --coverage-text 2> /dev/null", $output);
3535
$output = implode("\n", $output);
3636
$this->assertNotContains('FooCov', $output);
3737
$this->assertContains("SutNotFoundTest::test\nCould not find the tested class.", $output);

src/Symfony/Bridge/PhpUnit/bin/simple-phpunit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ if ('phpdbg' === PHP_SAPI) {
7777
$PHP .= ' -qrr';
7878
}
7979

80-
$COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar') || ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar`) : `which composer.phar`))
80+
$COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar') || ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar`) : `which composer.phar 2> /dev/null`))
8181
? $PHP.' '.escapeshellarg($COMPOSER)
8282
: 'composer';
8383

src/Symfony/Bundle/FrameworkBundle/Client.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ class Client extends BaseClient
3030
private $hasPerformedRequest = false;
3131
private $profiler = false;
3232
private $reboot = true;
33-
private $container;
33+
private $testContainerId;
3434

3535
/**
3636
* {@inheritdoc}
3737
*/
38-
public function __construct(KernelInterface $kernel, array $server = array(), History $history = null, CookieJar $cookieJar = null, ContainerInterface $container = null)
38+
public function __construct(KernelInterface $kernel, array $server = array(), History $history = null, CookieJar $cookieJar = null, string $testContainerId = null)
3939
{
4040
parent::__construct($kernel, $server, $history, $cookieJar);
41-
$this->container = $container;
41+
$this->testContainerId = $testContainerId;
4242
}
4343

4444
/**
@@ -48,7 +48,9 @@ public function __construct(KernelInterface $kernel, array $server = array(), Hi
4848
*/
4949
public function getContainer()
5050
{
51-
return $this->container ?? $this->kernel->getContainer();
51+
$container = $this->kernel->getContainer();
52+
53+
return null !== $this->testContainerId ? $container->get($this->testContainerId) : $container;
5254
}
5355

5456
/**

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TestServiceContainerRealRefPass.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,21 @@ public function process(ContainerBuilder $container)
2727
}
2828

2929
$testContainer = $container->getDefinition('test.service_container');
30-
$privateContainer = $container->getDefinition((string) $testContainer->getArgument(2));
30+
$privateContainer = $testContainer->getArgument(2);
31+
if ($privateContainer instanceof Reference) {
32+
$privateContainer = $container->getDefinition((string) $privateContainer);
33+
}
3134
$definitions = $container->getDefinitions();
35+
$privateServices = $privateContainer->getArgument(0);
3236

33-
foreach ($privateContainer->getArgument(0) as $id => $argument) {
37+
foreach ($privateServices as $id => $argument) {
3438
if (isset($definitions[$target = (string) $argument->getValues()[0]])) {
3539
$argument->setValues(array(new Reference($target)));
40+
} else {
41+
unset($privateServices[$id]);
3642
}
3743
}
44+
45+
$privateContainer->replaceArgument(0, $privateServices);
3846
}
3947
}

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TestServiceContainerWeakRefPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ public function process(ContainerBuilder $container)
3131
$definitions = $container->getDefinitions();
3232

3333
foreach ($definitions as $id => $definition) {
34-
if ((!$definition->isPublic() || $definition->isPrivate()) && !$definition->getErrors() && !$definition->isAbstract()) {
34+
if ($id && '.' !== $id[0] && (!$definition->isPublic() || $definition->isPrivate()) && !$definition->getErrors() && !$definition->isAbstract()) {
3535
$privateServices[$id] = new ServiceClosureArgument(new Reference($id, ContainerBuilder::IGNORE_ON_UNINITIALIZED_REFERENCE));
3636
}
3737
}
3838

3939
$aliases = $container->getAliases();
4040

4141
foreach ($aliases as $id => $alias) {
42-
if (!$alias->isPublic() || $alias->isPrivate()) {
42+
if ($id && '.' !== $id[0] && (!$alias->isPublic() || $alias->isPrivate())) {
4343
while (isset($aliases[$target = (string) $alias])) {
4444
$alias = $aliases[$target];
4545
}

0 commit comments

Comments
 (0)