Skip to content

Commit e40905a

Browse files
Merge branch '3.3' into 3.4
* 3.3: [Bridge\PhpUnit] Disable broken auto-require mechanism of phpunit [SecurityBundle] Fix syntax error in test [Console] Remove remaining dead code bumped Symfony version to 3.3.14 bumped Symfony version to 2.8.32 bumped Symfony version to 2.7.39 updated VERSION for 3.3.13 updated CHANGELOG for 3.3.13 updated VERSION for 2.8.31 updated CHANGELOG for 2.8.31 updated VERSION for 2.7.38 updated CHANGELOG for 2.7.38 Replace array|\Traversable by iterable Fix ambiguous pattern
2 parents fa7dd8e + a3d398e commit e40905a

File tree

16 files changed

+99
-74
lines changed

16 files changed

+99
-74
lines changed

CHANGELOG-3.3.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ in 3.3 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/v3.3.0...v3.3.1
99

10+
* 3.3.13 (2017-11-16)
11+
12+
* security #24995 Validate redirect targets using the session cookie domain (nicolas-grekas)
13+
* security #24994 Prevent bundle readers from breaking out of paths (xabbuh)
14+
* security #24993 Ensure that submitted data are uploaded files (xabbuh)
15+
* security #24992 Namespace generated CSRF tokens depending of the current scheme (dunglas)
16+
1017
* 3.3.12 (2017-11-13)
1118

1219
* bug #24954 [DI] Fix dumping with custom base class (nicolas-grekas)
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bridge\PhpUnit;
13+
14+
/**
15+
* Utility class replacing PHPUnit's implementation of the same class.
16+
*
17+
* All files are blacklisted so that process-isolated tests don't start with broken
18+
* "require_once" statements. Composer is the only supported way to load code there.
19+
*/
20+
class Blacklist
21+
{
22+
public static $blacklistedClassNames = array();
23+
24+
public function getBlacklistedDirectories()
25+
{
26+
$root = dirname(__DIR__);
27+
while ($root !== $parent = dirname($root)) {
28+
$root = $parent;
29+
}
30+
31+
return array($root);
32+
}
33+
34+
public function isBlacklisted($file)
35+
{
36+
return true;
37+
}
38+
}
39+
40+
class_alias('Symfony\Bridge\PhpUnit\Blacklist', 'PHPUnit\Util\Blacklist');
41+
class_alias('Symfony\Bridge\PhpUnit\Blacklist', 'PHPUnit_Util_Blacklist');

src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use PHPUnit\Framework\AssertionFailedError;
1616
use PHPUnit\Framework\TestCase;
1717
use PHPUnit\Framework\TestSuite;
18-
use PHPUnit\Util\Blacklist;
1918
use Symfony\Bridge\PhpUnit\ClockMock;
2019
use Symfony\Bridge\PhpUnit\DnsMock;
2120

@@ -46,17 +45,6 @@ class SymfonyTestsListenerTrait
4645
*/
4746
public function __construct(array $mockedNamespaces = array())
4847
{
49-
if (class_exists('PHPUnit_Util_Blacklist')) {
50-
\PHPUnit_Util_Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\DeprecationErrorHandler'] = 1;
51-
\PHPUnit_Util_Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\SymfonyTestsListener'] = 1;
52-
\PHPUnit_Util_Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListener'] = 1;
53-
\PHPUnit_Util_Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait'] = 1;
54-
} else {
55-
Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\DeprecationErrorHandler'] = 1;
56-
Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\SymfonyTestsListener'] = 1;
57-
Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait'] = 1;
58-
}
59-
6048
$warn = false;
6149
foreach ($mockedNamespaces as $type => $namespaces) {
6250
if (!is_array($namespaces)) {
@@ -103,7 +91,7 @@ public function globalListenerDisabled()
10391

10492
public function startTestSuite($suite)
10593
{
106-
if (class_exists('PHPUnit_Util_Blacklist', false)) {
94+
if (class_exists('PHPUnit_Util_Test', false)) {
10795
$Test = 'PHPUnit_Util_Test';
10896
} else {
10997
$Test = 'PHPUnit\Util\Test';
@@ -190,7 +178,7 @@ public function startTest($test)
190178
putenv('SYMFONY_DEPRECATIONS_SERIALIZE='.$this->runsInSeparateProcess);
191179
}
192180

193-
if (class_exists('PHPUnit_Util_Blacklist', false)) {
181+
if (class_exists('PHPUnit_Util_Test', false)) {
194182
$Test = 'PHPUnit_Util_Test';
195183
$AssertionFailedError = 'PHPUnit_Framework_AssertionFailedError';
196184
} else {
@@ -236,7 +224,7 @@ public function addWarning($test, $e, $time)
236224

237225
public function endTest($test, $time)
238226
{
239-
if (class_exists('PHPUnit_Util_Blacklist', false)) {
227+
if (class_exists('PHPUnit_Util_Test', false)) {
240228
$Test = 'PHPUnit_Util_Test';
241229
$BaseTestRunner = 'PHPUnit_Runner_BaseTestRunner';
242230
$Warning = 'PHPUnit_Framework_Warning';

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,6 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
8282
define('PHPUNIT_COMPOSER_INSTALL', __DIR__.'/vendor/autoload.php');
8383
require PHPUNIT_COMPOSER_INSTALL;
8484
85-
if (!class_exists('SymfonyBlacklistPhpunit', false)) {
86-
class SymfonyBlacklistPhpunit {}
87-
}
88-
if (class_exists('PHPUnit_Util_Blacklist')) {
89-
PHPUnit_Util_Blacklist::$blacklistedClassNames['SymfonyBlacklistPhpunit'] = 1;
90-
PHPUnit_Util_Blacklist::$blacklistedClassNames['SymfonyBlacklistSimplePhpunit'] = 1;
91-
} else {
92-
PHPUnit\Util\Blacklist::$blacklistedClassNames['SymfonyBlacklistPhpunit'] = 1;
93-
PHPUnit\Util\Blacklist::$blacklistedClassNames['SymfonyBlacklistSimplePhpunit'] = 1;
94-
}
95-
9685
Symfony\Bridge\PhpUnit\TextUI\Command::main();
9786

9887
EOPHP
@@ -211,9 +200,6 @@ if ($components) {
211200
}
212201
}
213202
} elseif (!isset($argv[1]) || 'install' !== $argv[1] || file_exists('install')) {
214-
if (!class_exists('SymfonyBlacklistSimplePhpunit', false)) {
215-
class SymfonyBlacklistSimplePhpunit {}
216-
}
217203
array_splice($argv, 1, 0, array('--colors=always'));
218204
$_SERVER['argv'] = $argv;
219205
$_SERVER['argc'] = ++$argc;

src/Symfony/Bridge/PhpUnit/bootstrap.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
use Doctrine\Common\Annotations\AnnotationRegistry;
1313
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler;
1414

15+
// Replace the native phpunit Blacklist, it's a broken artifact from the past
16+
require_once __DIR__.'/Blacklist.php';
17+
1518
// Detect if we need to serialize deprecations to a file.
1619
if ($file = getenv('SYMFONY_DEPRECATIONS_SERIALIZE')) {
1720
DeprecationErrorHandler::collectDeprecations($file);

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSessionDomainConstraintPassTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ private function createContainer($sessionStorageOptions)
126126
$ext = new SecurityExtension();
127127
$ext->load($config, $container);
128128

129-
(new AddSessionDomainConstraintPass())->process($container);
129+
$pass = new AddSessionDomainConstraintPass();
130+
$pass->process($container);
130131

131132
return $container;
132133
}

src/Symfony/Component/Console/Application.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,10 @@ public function run(InputInterface $input = null, OutputInterface $output = null
128128
$e = null;
129129
$exitCode = $this->doRun($input, $output);
130130
} catch (\Exception $e) {
131-
} catch (\Throwable $e) {
132131
}
133132

134133
if (null !== $e) {
135-
if (!$this->catchExceptions || !$e instanceof \Exception) {
134+
if (!$this->catchExceptions) {
136135
throw $e;
137136
}
138137

@@ -1059,8 +1058,8 @@ public function extractNamespace($name, $limit = null)
10591058
* Finds alternative of $name among $collection,
10601059
* if nothing is found in $collection, try in $abbrevs.
10611060
*
1062-
* @param string $name The string
1063-
* @param array|\Traversable $collection The collection
1061+
* @param string $name The string
1062+
* @param iterable $collection The collection
10641063
*
10651064
* @return string[] A sorted array of similar string
10661065
*/

src/Symfony/Component/Console/Question/Question.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function setHiddenFallback($fallback)
117117
/**
118118
* Gets values for the autocompleter.
119119
*
120-
* @return null|array|\Traversable
120+
* @return null|iterable
121121
*/
122122
public function getAutocompleterValues()
123123
{
@@ -127,7 +127,7 @@ public function getAutocompleterValues()
127127
/**
128128
* Sets values for the autocompleter.
129129
*
130-
* @param null|array|\Traversable $values
130+
* @param null|iterable $values
131131
*
132132
* @return $this
133133
*

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ public function copy($originFile, $targetFile, $overwriteNewerFiles = false)
8383
/**
8484
* Creates a directory recursively.
8585
*
86-
* @param string|array|\Traversable $dirs The directory path
87-
* @param int $mode The directory mode
86+
* @param string|iterable $dirs The directory path
87+
* @param int $mode The directory mode
8888
*
8989
* @throws IOException On any directory creation failure
9090
*/
@@ -111,7 +111,7 @@ public function mkdir($dirs, $mode = 0777)
111111
/**
112112
* Checks the existence of files or directories.
113113
*
114-
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to check
114+
* @param string|iterable $files A filename, an array of files, or a \Traversable instance to check
115115
*
116116
* @return bool true if the file exists, false otherwise
117117
*/
@@ -135,9 +135,9 @@ public function exists($files)
135135
/**
136136
* Sets access and modification time of file.
137137
*
138-
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to create
139-
* @param int $time The touch time as a Unix timestamp
140-
* @param int $atime The access time as a Unix timestamp
138+
* @param string|iterable $files A filename, an array of files, or a \Traversable instance to create
139+
* @param int $time The touch time as a Unix timestamp
140+
* @param int $atime The access time as a Unix timestamp
141141
*
142142
* @throws IOException When touch fails
143143
*/
@@ -154,7 +154,7 @@ public function touch($files, $time = null, $atime = null)
154154
/**
155155
* Removes files or directories.
156156
*
157-
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to remove
157+
* @param string|iterable $files A filename, an array of files, or a \Traversable instance to remove
158158
*
159159
* @throws IOException When removal fails
160160
*/
@@ -190,10 +190,10 @@ public function remove($files)
190190
/**
191191
* Change mode for an array of files or directories.
192192
*
193-
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change mode
194-
* @param int $mode The new mode (octal)
195-
* @param int $umask The mode mask (octal)
196-
* @param bool $recursive Whether change the mod recursively or not
193+
* @param string|iterable $files A filename, an array of files, or a \Traversable instance to change mode
194+
* @param int $mode The new mode (octal)
195+
* @param int $umask The mode mask (octal)
196+
* @param bool $recursive Whether change the mod recursively or not
197197
*
198198
* @throws IOException When the change fail
199199
*/
@@ -212,9 +212,9 @@ public function chmod($files, $mode, $umask = 0000, $recursive = false)
212212
/**
213213
* Change the owner of an array of files or directories.
214214
*
215-
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change owner
216-
* @param string $user The new owner user name
217-
* @param bool $recursive Whether change the owner recursively or not
215+
* @param string|iterable $files A filename, an array of files, or a \Traversable instance to change owner
216+
* @param string $user The new owner user name
217+
* @param bool $recursive Whether change the owner recursively or not
218218
*
219219
* @throws IOException When the change fail
220220
*/
@@ -239,9 +239,9 @@ public function chown($files, $user, $recursive = false)
239239
/**
240240
* Change the group of an array of files or directories.
241241
*
242-
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change group
243-
* @param string $group The group name
244-
* @param bool $recursive Whether change the group recursively or not
242+
* @param string|iterable $files A filename, an array of files, or a \Traversable instance to change group
243+
* @param string $group The group name
244+
* @param bool $recursive Whether change the group recursively or not
245245
*
246246
* @throws IOException When the change fail
247247
*/

src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ class ArrayChoiceList implements ChoiceListInterface
5656
*
5757
* The given choice array must have the same array keys as the value array.
5858
*
59-
* @param array|\Traversable $choices The selectable choices
60-
* @param callable|null $value The callable for creating the value
61-
* for a choice. If `null` is passed,
62-
* incrementing integers are used as
63-
* values
59+
* @param iterable $choices The selectable choices
60+
* @param callable|null $value The callable for creating the value
61+
* for a choice. If `null` is passed,
62+
* incrementing integers are used as
63+
* values
6464
*/
6565
public function __construct($choices, callable $value = null)
6666
{

src/Symfony/Component/Form/ChoiceList/Factory/ChoiceListFactoryInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ interface ChoiceListFactoryInterface
3131
* The callable receives the choice as first and the array key as the second
3232
* argument.
3333
*
34-
* @param array|\Traversable $choices The choices
35-
* @param null|callable $value The callable generating the choice
36-
* values
34+
* @param iterable $choices The choices
35+
* @param null|callable $value The callable generating the choice
36+
* values
3737
*
3838
* @return ChoiceListInterface The choice list
3939
*/

src/Symfony/Component/Form/ChoiceList/Factory/PropertyAccessDecorator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function getDecoratedFactory()
6363
/**
6464
* {@inheritdoc}
6565
*
66-
* @param array|\Traversable $choices The choices
66+
* @param iterable $choices The choices
6767
* @param null|callable|string|PropertyPath $value The callable or path for
6868
* generating the choice values
6969
*

src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,11 @@ private function writeArray($file, array $value, $indentation)
195195
/**
196196
* Writes a "table" node.
197197
*
198-
* @param resource $file The file handle to write to
199-
* @param array|\Traversable $value The value of the node
200-
* @param int $indentation The number of levels to indent
201-
* @param bool $fallback Whether the table should be merged
202-
* with the fallback locale
198+
* @param resource $file The file handle to write to
199+
* @param iterable $value The value of the node
200+
* @param int $indentation The number of levels to indent
201+
* @param bool $fallback Whether the table should be merged
202+
* with the fallback locale
203203
*
204204
* @throws UnexpectedTypeException when $value is not an array and not a
205205
* \Traversable instance

src/Symfony/Component/PropertyAccess/PropertyAccessor.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -645,11 +645,11 @@ private function writeProperty($zval, $property, $value)
645645
/**
646646
* Adjusts a collection-valued property by calling add*() and remove*() methods.
647647
*
648-
* @param array $zval The array containing the object to write to
649-
* @param string $property The property to write
650-
* @param array|\Traversable $collection The collection to write
651-
* @param string $addMethod The add*() method
652-
* @param string $removeMethod The remove*() method
648+
* @param array $zval The array containing the object to write to
649+
* @param string $property The property to write
650+
* @param iterable $collection The collection to write
651+
* @param string $addMethod The add*() method
652+
* @param string $removeMethod The remove*() method
653653
*/
654654
private function writeCollection($zval, $property, $collection, $addMethod, $removeMethod)
655655
{

src/Symfony/Component/Validator/Constraints/UrlValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class UrlValidator extends ConstraintValidator
2525
(%s):// # protocol
2626
(([\.\pL\pN-]+:)?([\.\pL\pN-]+)@)? # basic auth
2727
(
28-
([\pL\pN\pS-\.])+(\.?([\pL\pN]|xn\-\-[\pL\pN-]+)+\.?) # a domain name
28+
([\pL\pN\pS\-\.])+(\.?([\pL\pN]|xn\-\-[\pL\pN-]+)+\.?) # a domain name
2929
| # or
3030
\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} # an IP address
3131
| # or

src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ private function validateObject($object, $propertyPath, array $groups, $traversa
374374
* objects are iterated as well. Nested arrays are always iterated,
375375
* regardless of the value of $recursive.
376376
*
377-
* @param array|\Traversable $collection The collection
377+
* @param iterable $collection The collection
378378
* @param string $propertyPath The current property path
379379
* @param string[] $groups The validated groups
380380
* @param ExecutionContextInterface $context The current execution context

0 commit comments

Comments
 (0)