Skip to content

Commit 57657e8

Browse files
committed
Merge branch '4.2'
* 4.2: (45 commits) [Form] various minor fixes Ensure the parent process is always killed bugfix: the terminal state was wrong and not reseted [Console] Fix inconsistent result for choice questions in non-interactive mode Define null return type for Constraint::getDefaultOption() [Routing] Fix: annotation loader ignores method's default values [HttpKernel] Fix DebugHandlersListener constructor docblock Skip Glob brace test when GLOB_BRACE is unavailable bumped Symfony version to 4.2.6 updated VERSION for 4.2.5 updated CHANGELOG for 4.2.5 bumped Symfony version to 3.4.25 updated VERSION for 3.4.24 update CONTRIBUTORS for 3.4.24 updated CHANGELOG for 3.4.24 [EventDispatcher] cleanup fix testIgnoredAttributesInContext Re-generate icu 64.1 data Improve PHPdoc / IDE autocomplete for config tree builder [Bridge][Twig] DebugCommand - fix escaping and filter ...
2 parents 7d3e351 + 8796da9 commit 57657e8

16 files changed

+104
-104
lines changed

ClockMock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public static function register($class)
8383
{
8484
$self = \get_called_class();
8585

86-
$mockedNs = [substr($class, 0, strrpos($class, '\\'))];
86+
$mockedNs = array(substr($class, 0, strrpos($class, '\\')));
8787
if (0 < strpos($class, '\\Tests\\')) {
8888
$ns = str_replace('\\Tests\\', '\\', $class);
8989
$mockedNs[] = substr($ns, 0, strrpos($ns, '\\'));

DnsMock.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
*/
1717
class DnsMock
1818
{
19-
private static $hosts = [];
20-
private static $dnsTypes = [
19+
private static $hosts = array();
20+
private static $dnsTypes = array(
2121
'A' => DNS_A,
2222
'MX' => DNS_MX,
2323
'NS' => DNS_NS,
@@ -30,7 +30,7 @@ class DnsMock
3030
'NAPTR' => DNS_NAPTR,
3131
'TXT' => DNS_TXT,
3232
'HINFO' => DNS_HINFO,
33-
];
33+
);
3434

3535
/**
3636
* Configures the mock values for DNS queries.
@@ -68,7 +68,7 @@ public static function getmxrr($hostname, &$mxhosts, &$weight = null)
6868
if (!self::$hosts) {
6969
return \getmxrr($hostname, $mxhosts, $weight);
7070
}
71-
$mxhosts = $weight = [];
71+
$mxhosts = $weight = array();
7272

7373
if (isset(self::$hosts[$hostname])) {
7474
foreach (self::$hosts[$hostname] as $record) {
@@ -125,7 +125,7 @@ public static function gethostbynamel($hostname)
125125
$ips = false;
126126

127127
if (isset(self::$hosts[$hostname])) {
128-
$ips = [];
128+
$ips = array();
129129

130130
foreach (self::$hosts[$hostname] as $record) {
131131
if ('A' === $record['type']) {
@@ -149,11 +149,11 @@ public static function dns_get_record($hostname, $type = DNS_ANY, &$authns = nul
149149
if (DNS_ANY === $type) {
150150
$type = DNS_ALL;
151151
}
152-
$records = [];
152+
$records = array();
153153

154154
foreach (self::$hosts[$hostname] as $record) {
155155
if (isset(self::$dnsTypes[$record['type']]) && (self::$dnsTypes[$record['type']] & $type)) {
156-
$records[] = array_merge(['host' => $hostname, 'class' => 'IN', 'ttl' => 1, 'type' => $record['type']], $record);
156+
$records[] = array_merge(array('host' => $hostname, 'class' => 'IN', 'ttl' => 1, 'type' => $record['type']), $record);
157157
}
158158
}
159159
}
@@ -165,7 +165,7 @@ public static function register($class)
165165
{
166166
$self = \get_called_class();
167167

168-
$mockedNs = [substr($class, 0, strrpos($class, '\\'))];
168+
$mockedNs = array(substr($class, 0, strrpos($class, '\\')));
169169
if (0 < strpos($class, '\\Tests\\')) {
170170
$ns = str_replace('\\Tests\\', '\\', $class);
171171
$mockedNs[] = substr($ns, 0, strrpos($ns, '\\'));

Legacy/CoverageListenerTrait.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(callable $sutFqcnResolver = null, $warningOnSutNotFo
3131
{
3232
$this->sutFqcnResolver = $sutFqcnResolver;
3333
$this->warningOnSutNotFound = $warningOnSutNotFound;
34-
$this->warnings = [];
34+
$this->warnings = array();
3535
}
3636

3737
public function startTest($test)
@@ -42,7 +42,7 @@ public function startTest($test)
4242

4343
$annotations = $test->getAnnotations();
4444

45-
$ignoredAnnotations = ['covers', 'coversDefaultClass', 'coversNothing'];
45+
$ignoredAnnotations = array('covers', 'coversDefaultClass', 'coversNothing');
4646

4747
foreach ($ignoredAnnotations as $annotation) {
4848
if (isset($annotations['class'][$annotation]) || isset($annotations['method'][$annotation])) {
@@ -74,11 +74,11 @@ public function startTest($test)
7474
$r->setAccessible(true);
7575

7676
$cache = $r->getValue();
77-
$cache = array_replace_recursive($cache, [
78-
\get_class($test) => [
79-
'covers' => [$sutFqcn],
80-
],
81-
]);
77+
$cache = array_replace_recursive($cache, array(
78+
\get_class($test) => array(
79+
'covers' => array($sutFqcn),
80+
),
81+
));
8282
$r->setValue($testClass, $cache);
8383
}
8484

Legacy/SymfonyTestsListenerForV5.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class SymfonyTestsListenerForV5 extends \PHPUnit_Framework_BaseTestListener
2222
{
2323
private $trait;
2424

25-
public function __construct(array $mockedNamespaces = [])
25+
public function __construct(array $mockedNamespaces = array())
2626
{
2727
$this->trait = new SymfonyTestsListenerTrait($mockedNamespaces);
2828
}

Legacy/SymfonyTestsListenerForV6.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class SymfonyTestsListenerForV6 extends BaseTestListener
2727
{
2828
private $trait;
2929

30-
public function __construct(array $mockedNamespaces = [])
30+
public function __construct(array $mockedNamespaces = array())
3131
{
3232
$this->trait = new SymfonyTestsListenerTrait($mockedNamespaces);
3333
}

Legacy/SymfonyTestsListenerForV7.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class SymfonyTestsListenerForV7 implements TestListener
3030

3131
private $trait;
3232

33-
public function __construct(array $mockedNamespaces = [])
33+
public function __construct(array $mockedNamespaces = array())
3434
{
3535
$this->trait = new SymfonyTestsListenerTrait($mockedNamespaces);
3636
}

Legacy/SymfonyTestsListenerTrait.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ class SymfonyTestsListenerTrait
3232
private static $globallyEnabled = false;
3333
private $state = -1;
3434
private $skippedFile = false;
35-
private $wasSkipped = [];
36-
private $isSkipped = [];
37-
private $expectedDeprecations = [];
38-
private $gatheredDeprecations = [];
35+
private $wasSkipped = array();
36+
private $isSkipped = array();
37+
private $expectedDeprecations = array();
38+
private $gatheredDeprecations = array();
3939
private $previousErrorHandler;
4040
private $testsWithWarnings;
4141
private $reportUselessTests;
@@ -45,7 +45,7 @@ class SymfonyTestsListenerTrait
4545
/**
4646
* @param array $mockedNamespaces List of namespaces, indexed by mocked features (time-sensitive or dns-sensitive)
4747
*/
48-
public function __construct(array $mockedNamespaces = [])
48+
public function __construct(array $mockedNamespaces = array())
4949
{
5050
if (class_exists('PHPUnit_Util_Blacklist')) {
5151
\PHPUnit_Util_Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait'] = 2;
@@ -57,7 +57,7 @@ public function __construct(array $mockedNamespaces = [])
5757

5858
foreach ($mockedNamespaces as $type => $namespaces) {
5959
if (!\is_array($namespaces)) {
60-
$namespaces = [$namespaces];
60+
$namespaces = array($namespaces);
6161
}
6262
if ('time-sensitive' === $type) {
6363
foreach ($namespaces as $ns) {
@@ -104,7 +104,7 @@ public function startTestSuite($suite)
104104
$Test = 'PHPUnit\Util\Test';
105105
}
106106
$suiteName = $suite->getName();
107-
$this->testsWithWarnings = [];
107+
$this->testsWithWarnings = array();
108108

109109
foreach ($suite->tests() as $test) {
110110
if (!($test instanceof \PHPUnit\Framework\TestCase || $test instanceof TestCase)) {
@@ -135,11 +135,11 @@ public function startTestSuite($suite)
135135

136136
if (!$this->wasSkipped = require $this->skippedFile) {
137137
echo "All tests already ran successfully.\n";
138-
$suite->setTests([]);
138+
$suite->setTests(array());
139139
}
140140
}
141141
}
142-
$testSuites = [$suite];
142+
$testSuites = array($suite);
143143
for ($i = 0; isset($testSuites[$i]); ++$i) {
144144
foreach ($testSuites[$i]->tests() as $test) {
145145
if ($test instanceof \PHPUnit_Framework_TestSuite || $test instanceof TestSuite) {
@@ -158,7 +158,7 @@ public function startTestSuite($suite)
158158
}
159159
}
160160
} elseif (2 === $this->state) {
161-
$skipped = [];
161+
$skipped = array();
162162
foreach ($suite->tests() as $test) {
163163
if (!($test instanceof \PHPUnit\Framework\TestCase || $test instanceof TestCase)
164164
|| isset($this->wasSkipped[$suiteName]['*'])
@@ -230,7 +230,7 @@ public function startTest($test)
230230
$test->getTestResultObject()->beStrictAboutTestsThatDoNotTestAnything(false);
231231

232232
$this->expectedDeprecations = $annotations['method']['expectedDeprecation'];
233-
$this->previousErrorHandler = set_error_handler([$this, 'handleError']);
233+
$this->previousErrorHandler = set_error_handler(array($this, 'handleError'));
234234
}
235235
}
236236
}
@@ -271,8 +271,8 @@ public function endTest($test, $time)
271271
$deprecations = file_get_contents($this->runsInSeparateProcess);
272272
unlink($this->runsInSeparateProcess);
273273
putenv('SYMFONY_DEPRECATIONS_SERIALIZE');
274-
foreach ($deprecations ? unserialize($deprecations) : [] as $deprecation) {
275-
$error = serialize(['deprecation' => $deprecation[1], 'class' => $className, 'method' => $test->getName(false), 'triggering_file' => isset($deprecation[2]) ? $deprecation[2] : null]);
274+
foreach ($deprecations ? unserialize($deprecations) : array() as $deprecation) {
275+
$error = serialize(array('deprecation' => $deprecation[1], 'class' => $className, 'method' => $test->getName(false), 'triggering_file' => isset($deprecation[2]) ? $deprecation[2] : null));
276276
if ($deprecation[0]) {
277277
@trigger_error($error, E_USER_DEPRECATED);
278278
} else {
@@ -283,13 +283,13 @@ public function endTest($test, $time)
283283
}
284284

285285
if ($this->expectedDeprecations) {
286-
if (!\in_array($test->getStatus(), [$BaseTestRunner::STATUS_SKIPPED, $BaseTestRunner::STATUS_INCOMPLETE], true)) {
286+
if (!\in_array($test->getStatus(), array($BaseTestRunner::STATUS_SKIPPED, $BaseTestRunner::STATUS_INCOMPLETE), true)) {
287287
$test->addToAssertionCount(\count($this->expectedDeprecations));
288288
}
289289

290290
restore_error_handler();
291291

292-
if (!$errored && !\in_array($test->getStatus(), [$BaseTestRunner::STATUS_SKIPPED, $BaseTestRunner::STATUS_INCOMPLETE, $BaseTestRunner::STATUS_FAILURE, $BaseTestRunner::STATUS_ERROR], true)) {
292+
if (!$errored && !\in_array($test->getStatus(), array($BaseTestRunner::STATUS_SKIPPED, $BaseTestRunner::STATUS_INCOMPLETE, $BaseTestRunner::STATUS_FAILURE, $BaseTestRunner::STATUS_ERROR), true)) {
293293
try {
294294
$prefix = "@expectedDeprecation:\n";
295295
$test->assertStringMatchesFormat($prefix.'%A '.implode("\n%A ", $this->expectedDeprecations)."\n%A", $prefix.' '.implode("\n ", $this->gatheredDeprecations)."\n");
@@ -300,20 +300,20 @@ public function endTest($test, $time)
300300
}
301301
}
302302

303-
$this->expectedDeprecations = $this->gatheredDeprecations = [];
303+
$this->expectedDeprecations = $this->gatheredDeprecations = array();
304304
$this->previousErrorHandler = null;
305305
}
306306
if (!$this->runsInSeparateProcess && -2 < $this->state && ($test instanceof \PHPUnit\Framework\TestCase || $test instanceof TestCase)) {
307307
if (\in_array('time-sensitive', $groups, true)) {
308308
ClockMock::withClockMock(false);
309309
}
310310
if (\in_array('dns-sensitive', $groups, true)) {
311-
DnsMock::withMockedHosts([]);
311+
DnsMock::withMockedHosts(array());
312312
}
313313
}
314314
}
315315

316-
public function handleError($type, $msg, $file, $line, $context = [])
316+
public function handleError($type, $msg, $file, $line, $context = array())
317317
{
318318
if (E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) {
319319
$h = $this->previousErrorHandler;

Legacy/TestRunnerForV5.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ protected function handleConfiguration(array &$arguments)
2727

2828
$result = parent::handleConfiguration($arguments);
2929

30-
$arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : [];
30+
$arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : array();
3131

3232
$registeredLocally = false;
3333

Legacy/TestRunnerForV6.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function handleConfiguration(array &$arguments)
3030

3131
parent::handleConfiguration($arguments);
3232

33-
$arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : [];
33+
$arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : array();
3434

3535
$registeredLocally = false;
3636

Legacy/TestRunnerForV7.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function handleConfiguration(array &$arguments): void
3030

3131
parent::handleConfiguration($arguments);
3232

33-
$arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : [];
33+
$arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : array();
3434

3535
$registeredLocally = false;
3636

0 commit comments

Comments
 (0)