8000 Merge branch '4.0' into 4.1 · symfony/symfony@d4d137d · GitHub
[go: up one dir, main page]

Skip to content

Commit d4d137d

Browse files
Merge branch '4.0' into 4.1
* 4.0: [HttpKernel] reset kernel start time on reboot Add code of Conduct links in our README bumped Symfony version to 4.0.12 [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 [HttpFoundation] Fix cookie test with xdebug [Serializer] Check the value of enable_max_depth if defined [DI] remove dead code [PhpUnitBridge] silence some stderr outputs [Validator] Update sl translation
2 parents ab09fcc + 101ff69 commit d4d137d

File tree

16 files changed

+163
-34
lines changed

16 files changed

+163
-34
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/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
10000 ? $PHP.' '.escapeshellarg($COMPOSER)
8282
: 'composer';
8383

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,15 @@ protected function processValue($value, $isRoot = false)
8888
*/
8989
private function isInlineableDefinition($id, Definition $definition, ServiceReferenceGraph $graph)
9090
{
91+
if ($definition->getErrors() || $definition->isDeprecated() || $definition->isLazy() || $definition->isSynthetic()) {
92+
return false;
93+
}
94+
9195
if (!$definition->isShared()) {
9296
return true;
9397
}
9498

95-
if ($definition->isDeprecated() || $definition->isPublic() || $definition->isLazy() || $definition->getErrors()) {
99+
if ($definition->isPublic()) {
96100
return false;
97101
}
98102

src/Symfony/Component/DependencyInjection/LazyProxy/ProxyHelper.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,4 @@ public static function getTypeHint(\ReflectionFunctionAbstract $r, \ReflectionPa
5454
return $prefix.$parent->name;
5555
}
5656
}
57-
58-
private static function export($value)
59-
{
60-
if (!is_array($value)) {
61-
return var_export($value, true);
62-
}
63-
$code = array();
64-
foreach ($value as $k => $v) {
65-
$code[] = sprintf('%s => %s', var_export($k, true), self::export($v));
66-
}
67-
68-
return sprintf('array(%s)', implode(', ', $code));
69-
}
7057
}

src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\DependencyInjection\Tests\Dumper;
1313

14-
use DummyProxyDumper;
1514
use PHPUnit\Framework\TestCase;
1615
use Psr\Container\ContainerInterface;
1716
use Symfony\Component\Config\FileLocator;
@@ -530,6 +529,19 @@ public function testInlinedDefinitionReferencingServiceContainer()
530529
$this->assertStringEqualsFile(self::$fixturesPath.'/php/services13.php', $dumper->dump(), '->dump() dumps inline definitions which reference service_container');
531530
}
532531

532+
public function testNonSharedLazyDefinitionReferences()
533+
{
534+
$container = new ContainerBuilder();
535+
$container->register('foo', 'stdClass')->setShared(false)->setLazy(true);
536+
$container->register('bar', 'stdClass')->addArgument(new Reference('foo', ContainerBuilder::EXCEPTION_ON_INVALID_REFERENCE, false))->setPublic(true);
537+
$container->compile();
538+
539+
$dumper = new PhpDumper($container);
540+
$dumper->setProxyDumper(new \DummyProxyDumper());
541+
542+
$this->assertStringEqualsFile(self::$fixturesPath.'/php/services_non_shared_lazy.php', $dumper->dump());
543+
}
544+
533545
public function testInitializePropertiesBeforeMethodCalls()
534546
{
535547
require_once self::$fixturesPath.'/includes/classes.php';
@@ -598,7 +610,7 @@ public function testCircularReferenceAllowanceForInlinedDefinitionsForLazyServic
598610

599611
$dumper = new PhpDumper($container);
600612

601-
$dumper->setProxyDumper(new DummyProxyDumper());
613+
$dumper->setProxyDumper(new \DummyProxyDumper());
602614
$dumper->dump();
603615

604616
$this->addToAssertionCount(1);

src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,17 @@ class DummyProxyDumper implements ProxyDumper
8585
{
8686
public function isProxyCandidate(Definition $definition)
8787
{
88-
return false;
88+
return $definition->isLazy();
8989
}
9090

9191
public function getProxyFactoryCode(Definition $definition, $id, $factoryCall = null)
9292
{
93-
return '';
93+
return " // lazy factory\n\n";
9494
}
9595

9696
public function getProxyCode(Definition $definition)
9797
{
98-
return '';
98+
return "// proxy code\n";
9999
}
100100
}
101101

0 commit comments

Comments
 (0)
0