8000 Merge branch '2.3' into 2.5 · symfony/symfony@51aa13a · GitHub
[go: up one dir, main page]

Skip to content

Commit 51aa13a

Browse files
committed
Merge branch '2.3' into 2.5
* 2.3: [Config] adds missing « use » statement for InvalidTypeException type hint in documentation. [Config] fixes broken unit test on ArrayNode class. fixed CS [Security] Delete old session on auth strategy migrate update required minimum TwigBridge version Very minor grammar fix in error message [Tests] Silenced all deprecations in tests for 2.3 BinaryFileResponse - add missing newline fixed CS add a limit and a test to FlattenExceptionTest. CS: There should be no empty lines following phpdocs [FrameworkBundle] fix cache:clear command [2.3] Docblocks should not be followed by a blank line Fix return phpdoc [PropertyAccess] Added test to verify #5775 is fixed Conflicts: src/Symfony/Bundle/TwigBundle/composer.json src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php src/Symfony/Component/Security/Core/Tests/Validator/Constraints/UserPasswordValidatorTest.php
2 parents b2e0a80 + 405b881 commit 51aa13a

File tree

52 files changed

+236
-197
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+236
-197
lines changed

src/Symfony/Bridge/Doctrine/phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
colors="true"
77
bootstrap="Tests/bootstrap.php"
88
>
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
913
<testsuites>
1014
<testsuite name="Symfony Doctrine Bridge Test Suite">
1115
<directory>./Tests/</directory>

src/Symfony/Bridge/Monolog/phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
913
<testsuites>
1014
<testsuite name="Symfony Monolog Bridge Test Suite">
1115
<directory>./Tests/</directory>

src/Symfony/Bridge/Propel1/phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
913
<testsuites>
1014
<testsuite name="Symfony Propel1 Bridge Test Suite">
1115
<directory>./Tests/</directory>

src/Symfony/Bridge/ProxyManager/phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
913
<testsuites>
1014
<testsuite name="Symfony ProxyManager Bridge Test Suite">
1115
<directory>./Tests/</directory>

src/Symfony/Bridge/Twig/phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
913
<testsuites>
1014
<testsuite name="Symfony Twig Bridge Test Suite">
1115
<directory>./Tests/</directory>

src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7575
} else {
7676
// the warmup cache dir name must have the same length than the real one
7777
// to avoid the many problems in serialized resources files
78+
$realCacheDir = realpath($realCacheDir);
7879
$warmupDir = substr($realCacheDir, 0, -1).'_';
7980

8081
if ($filesystem->exists($warmupDir)) {
@@ -180,12 +181,14 @@ protected function warmup($warmupDir, $realCacheDir, $enableOptionalWarmers = tr
180181
*/
181182
protected function getTempKernel(KernelInterface $parent, $namespace, $parentClass, $warmupDir)
182183
{
183-
$rootDir = $parent->getRootDir();
184+
$cacheDir = var_export($warmupDir, true);
185+
$rootDir = var_export(realpath($parent->getRootDir()), true);
186+
$logDir = var_export(realpath($parent->getLogDir()), true);
184187
// the temp kernel class name must have the same length than the real one
185188
// to avoid the many problems in serialized resources files
186189
$class = substr($parentClass, 0, -1).'_';
187190
// the temp kernel name must be changed too
188-
$name = substr($parent->getName(), 0, -1).'_';
191+
$name = var_export(substr($parent->getName(), 0, -1).'_', true);
189192
$code = <<<EOF
190193
<?php
191194
@@ -195,17 +198,22 @@ class $class extends $parentClass
195198
{
196199
public function getCacheDir()
197200
{
198-
return '$warmupDir';
201+
return $cacheDir;
199202
}
200203
201204
public function getName()
202205
{
203-
return '$name';
206+
return $name;
204207
}
205208
206209
public function getRootDir()
207210
{
208-
return '$rootDir';
211+
return $rootDir;
212+
}
213+
214+
public function getLogDir()
215+
{
216+
return $logDir;
209217
}
210218
211219
protected function buildContainer()

src/Symfony/Bundle/FrameworkBundle/phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
913
<testsuites>
1014
<testsuite name="Symfony FrameworkBundle Test Suite">
1115
<directory>./Tests/</directory>

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ private function configureDbalAclProvider(array $config, ContainerBuilder $conta
163163
* @param array $config An array of configuration settings
164164
* @param ContainerBuilder $container A ContainerBuilder instance
165165
*/
166-
167166
private function createRoleHierarchy($config, ContainerBuilder $container)
168167
{
169168
if (!isset($config['role_hierarchy'])) {

src/Symfony/Bundle/SecurityBundle/phpunit.xml.dist

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
9-
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
1013
<testsuites>
1114
<testsuite name="Symfony SecurityBundle Test Suite">
1215
<directory>./Tests/</directory>

src/Symfony/Bundle/TwigBundle/phpunit.xml.dist

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
9-
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
1013
<testsuites>
1114
<testsuite name="Symfony TwigBundle Test Suite">
1215
<directory>./Tests/</directory>

src/Symfony/Bundle/WebProfilerBundle/phpunit.xml.dist

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
9-
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
1013
<testsuites>
1114
<testsuite name="Symfony WebProfilerBundle Test Suite">
1215
<directory>./Tests/</directory>

src/Symfony/Component/BrowserKit/phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
913
<testsuites>
1014
<testsuite name="Symfony BrowserKit Component Test Suite">
1115
<directory>./Tests/</directory>

src/Symfony/Component/ClassLoader/phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
913
<testsuites>
1014
<testsuite name="Symfony ClassLoader Component Test Suite">
1115
<directory>./Tests/</directory>

src/Symfony/Component/Config/Definition/ArrayNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ protected function normalizeValue($value)
302302

303303
// if extra fields are present, throw exception
304304
if (count($value) && !$this->ignoreExtraKeys) {
305-
$msg = sprintf('Unrecognized options "%s" under "%s"', implode(', ', array_keys($value)), $this->getPath());
305+
$msg = sprintf('Unrecognized option%s "%s" under "%s"', 1 === count($value) ? '' : 's', implode(', ', array_keys($value)), $this->getPath());
306306
$ex = new InvalidConfigurationException($msg);
307307
$ex->setPath($this->getPath());
308308

src/Symfony/Component/Config/Definition/BaseNode.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\Config\Definition\Exception\Exception;
1515
use Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException;
1616
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
17+
use Symfony\Component\Config\Definition\Exception\InvalidTypeException;
1718

1819
/**
1920
* The base node class

src/Symfony/Component/Config/Tests/Definition/ArrayNodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function testNormalizeThrowsExceptionWhenFalseIsNotAllowed()
2727

2828
/**
2929
* @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
30-
* @expectedExceptionMessage Unrecognized options "foo" under "root"
30+
* @expectedExceptionMessage Unrecognized option "foo" under "root"
3131
*/
3232
public function testExceptionThrownOnUnrecognizedChild()
3333
{

src/Symfony/Component/Config/phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
913
<testsuites>
1014
<testsuite name="Symfony Config Component Test Suite">
1115
<directory>./Tests/</directory>

src/Symfony/Component/Console/phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
913
<testsuites>
1014
<testsuite name="Symfony Console Component Test Suite">
1115
<directory>./Tests/</directory>

src/Symfony/Component/CssSelector/phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
913
<testsuites>
1014
<testsuite name="Symfony CssSelector Component Test Suite">
1115
<directory>./Tests/</directory>

src/Symfony/Component/Debug/Exception/FlattenException.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,17 +210,20 @@ public function setTrace($trace, $file, $line)
210210
}
211211
}
212212

213-
private function flattenArgs($args, $level = 0)
213< 10000 /td>+
private function flattenArgs($args, $level = 0, &$count = 0)
214214
{
215215
$result = array();
216216
foreach ($args as $key => $value) {
217+
if (++$count > 1e4) {
218+
return array('array', '*SKIPPED over 10000 entries*');
219+
}
217220
if (is_object($value)) {
218221
$result[$key] = array('object', get_class($value));
219222
} elseif (is_array($value)) {
220223
if ($level > 10) {
221224
$result[$key] = array('array', '*DEEP NESTED ARRAY*');
222225
} else {
223-
$result[$key] = array('array', $this->flattenArgs($value, $level + 1));
226+
$result[$key] = array('array', $this->flattenArgs($value, $level + 1, $count));
224227
}
225228
} elseif (null === $value) {
226229
$result[$key] = array('null', null);

src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,28 @@ public function testRecursionInArguments()
186186
$this->assertContains('*DEEP NESTED ARRAY*', serialize($trace));
187187
}
188188

189+
public function testTooBigArray()
190+
{
191+
$a = array();
192+
for ($i = 0; $i < 20; $i++) {
193+
for ($j = 0; $j < 50; $j++) {
194+
for ($k = 0; $k < 10; $k++) {
195+
$a[$i][$j][$k] = 'value';
196+
}
197+
}
198+
}
199+
$a[20] = 'value';
200+
$a[21] = 'value1';
201+
$exception = $this->createException($a);
202+
203+
$flattened = FlattenException::create($exception);
204+
$trace = $flattened->getTrace();
205+
$serializeTrace = serialize($trace);
206+
207+
$this->assertContains('*SKIPPED over 10000 entries*', $serializeTrace);
208+
$this->assertNotContains('*value1*', $serializeTrace);
209+
}
210+
189211
private function createException($foo)
190212
{
191213
return new \Exception();

src/Symfony/Component/Debug/phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
913
<testsuites>
1014
<testsuite name="Symfony Debug Component Test Suite">
1115
<directory>./Tests/</directory>

src/Symfony/Component/DependencyInjection/phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
913
<testsuites>
1014
<testsuite name="Symfony DependencyInjection Component Test Suite">
1115
<directory>./Tests/</directory>

src/Symfony/Component/DomCrawler/phpunit.xml.dist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
13+
914
<testsuites>
1015
<testsuite name="Symfony DomCrawler Component Test Suite">
1116
<directory>./Tests/</directory>

src/Symfony/Component/EventDispatcher/phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
913
<testsuites>
1014
<testsuite name="Symfony EventDispatcher Component Test Suite">
1115
<directory>./Tests/</directory>

src/Symfony/Component/Filesystem/phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
913
<testsuites>
1014
<testsuite name="Symfony Filesystem Component Test Suite">
1115
<directory>./Tests/</directory>

src/Symfony/Component/Finder/phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
913
<testsuites>
1014
<testsuite name="Symfony Finder Component Test Suite">
1115
<directory>./Tests/</directory>

src/Symfony/Component/Form/phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
9+
<php>
10+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
11+
<ini name="error_reporting" value="-16385"/>
12+
</php>
913
<testsuites>
1014
<testsuite name="Symfony Form Component Test Suite">
1115
<directory>./Tests/</directory>

src/Symfony/Component/HttpFoundation/BinaryFileResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
/**
3+
/*
44
* This file is part of the Symfony package.
55
*
66
* (c) Fabien Potencier <fabien@symfony.com>
@@ -62,7 +62,7 @@ public function __construct($file, $status = 200, $headers = array(), $public =
6262
* @param bool $autoEtag Whether the ETag header should be automatically set
6363
* @param bool $autoLastModified Whether the Last-Modified header should be automatically set
6464
*
65-
* @return BinaryResponse The created response
65+
* @return BinaryFileResponse The created response
6666
*/
6767
public static function create($file = null, $status = 200, $headers = array(), $public = true, $contentDisposition = null, $autoEtag = false, $autoLastModified = true)
6868
{

src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*
1717
* @see http://php.net/sessionhandler
1818
*/
19-
2019
if (PHP_VERSION_ID >= 50400) {
2120
class NativeSessionHandler extends \SessionHandler
2221
{

0 commit comments

Comments
 (0)
0