Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0346026

Browse filesBrowse files
Merge branch '4.4' into 5.1
* 4.4: Enable "native_constant_invocation" CS rule Make AbstractPhpFileCacheWarmer public
2 parents 2e8ca94 + 6c2a1c9 commit 0346026
Copy full SHA for 0346026

File tree

360 files changed

+1465
-1467
lines changed
Filter options

Some content is hidden

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

360 files changed

+1465
-1467
lines changed

‎.php_cs.dist

Copy file name to clipboardExpand all lines: .php_cs.dist
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ return PhpCsFixer\Config::create()
1313
'array_syntax' => ['syntax' => 'short'],
1414
'fopen_flags' => false,
1515
'protected_to_private' => false,
16+
'native_constant_invocation' => true,
1617
'combine_nested_dirname' => true,
1718
])
1819
->setRiskyAllowed(true)

‎src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,11 @@ protected function detectMetadataDriver(string $dir, ContainerBuilder $container
242242
$configPath = $this->getMappingResourceConfigDirectory();
243243
$extension = $this->getMappingResourceExtension();
244244

245-
if (glob($dir.'/'.$configPath.'/*.'.$extension.'.xml', GLOB_NOSORT)) {
245+
if (glob($dir.'/'.$configPath.'/*.'.$extension.'.xml', \GLOB_NOSORT)) {
246246
$driver = 'xml';
247-
} elseif (glob($dir.'/'.$configPath.'/*.'.$extension.'.yml', GLOB_NOSORT)) {
247+
} elseif (glob($dir.'/'.$configPath.'/*.'.$extension.'.yml', \GLOB_NOSORT)) {
248248
$driver = 'yml';
249-
} elseif (glob($dir.'/'.$configPath.'/*.'.$extension.'.php', GLOB_NOSORT)) {
249+
} elseif (glob($dir.'/'.$configPath.'/*.'.$extension.'.php', \GLOB_NOSORT)) {
250250
$driver = 'php';
251251
} else {
252252
// add the closest existing directory as a resource

‎src/Symfony/Bridge/Monolog/Handler/ServerLogHandler.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Monolog/Handler/ServerLogHandler.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ protected function write(array $record): void
9999

100100
try {
101101
if (-1 === stream_socket_sendto($this->socket, $recordFormatted)) {
102-
stream_socket_shutdown($this->socket, STREAM_SHUT_RDWR);
102+
stream_socket_shutdown($this->socket, \STREAM_SHUT_RDWR);
103103

104104
// Let's retry: the persistent connection might just be stale
105105
if ($this->socket = $this->createSocket()) {
@@ -125,7 +125,7 @@ private static function nullErrorHandler()
125125

126126
private function createSocket()
127127
{
128-
$socket = stream_socket_client($this->host, $errno, $errstr, 0, STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT | STREAM_CLIENT_PERSISTENT, $this->context);
128+
$socket = stream_socket_client($this->host, $errno, $errstr, 0, \STREAM_CLIENT_CONNECT | \STREAM_CLIENT_ASYNC_CONNECT | \STREAM_CLIENT_PERSISTENT, $this->context);
129129

130130
if ($socket) {
131131
stream_set_blocking($socket, false);

‎src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public static function collectDeprecations($outputFile)
8888
{
8989
$deprecations = [];
9090
$previousErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$deprecations, &$previousErrorHandler) {
91-
if (E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type && (E_WARNING !== $type || false === strpos($msg, '" targeting switch is equivalent to "break'))) {
91+
if (\E_USER_DEPRECATED !== $type && \E_DEPRECATED !== $type && (\E_WARNING !== $type || false === strpos($msg, '" targeting switch is equivalent to "break'))) {
9292
if ($previousErrorHandler) {
9393
return $previousErrorHandler($type, $msg, $file, $line, $context);
9494
}
@@ -120,7 +120,7 @@ public static function collectDeprecations($outputFile)
120120
*/
121121
public function handleError($type, $msg, $file, $line, $context = [])
122122
{
123-
if ((E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type && (E_WARNING !== $type || false === strpos($msg, '" targeting switch is equivalent to "break'))) || !$this->getConfiguration()->isEnabled()) {
123+
if ((\E_USER_DEPRECATED !== $type && \E_DEPRECATED !== $type && (\E_WARNING !== $type || false === strpos($msg, '" targeting switch is equivalent to "break'))) || !$this->getConfiguration()->isEnabled()) {
124124
return \call_user_func(self::getPhpUnitErrorHandler(), $type, $msg, $file, $line, $context);
125125
}
126126

@@ -336,7 +336,7 @@ private static function getPhpUnitErrorHandler()
336336
return 'PHPUnit\Util\ErrorHandler::handleError';
337337
}
338338

339-
foreach (debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS) as $frame) {
339+
foreach (debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT | \DEBUG_BACKTRACE_IGNORE_ARGS) as $frame) {
340340
if (isset($frame['object']) && $frame['object'] instanceof TestResult) {
341341
return new ErrorHandler(
342342
$frame['object']->getConvertDeprecationsToExceptions(),
@@ -375,21 +375,21 @@ private static function hasColorSupport()
375375

376376
if (\DIRECTORY_SEPARATOR === '\\') {
377377
return (\function_exists('sapi_windows_vt100_support')
378-
&& sapi_windows_vt100_support(STDOUT))
378+
&& sapi_windows_vt100_support(\STDOUT))
379379
|| false !== getenv('ANSICON')
380380
|| 'ON' === getenv('ConEmuANSI')
381381
|| 'xterm' === getenv('TERM');
382382
}
383383

384384
if (\function_exists('stream_isatty')) {
385-
return stream_isatty(STDOUT);
385+
return stream_isatty(\STDOUT);
386386
}
387387

388388
if (\function_exists('posix_isatty')) {
389-
return posix_isatty(STDOUT);
389+
return posix_isatty(\STDOUT);
390390
}
391391

392-
$stat = fstat(STDOUT);
392+
$stat = fstat(\STDOUT);
393393

394394
// Check if formatted mode is S_IFCHR
395395
return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;

‎src/Symfony/Bridge/PhpUnit/Tests/DnsMockTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/Tests/DnsMockTest.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ public function testDnsGetRecord()
141141

142142
$this->assertFalse(DnsMock::dns_get_record('foobar.com'));
143143
$this->assertSame($records, DnsMock::dns_get_record('example.com'));
144-
$this->assertSame($records, DnsMock::dns_get_record('example.com', DNS_ALL));
145-
$this->assertSame($records, DnsMock::dns_get_record('example.com', DNS_A | DNS_PTR));
146-
$this->assertSame([$ptr], DnsMock::dns_get_record('example.com', DNS_PTR));
144+
$this->assertSame($records, DnsMock::dns_get_record('example.com', \DNS_ALL));
145+
$this->assertSame($records, DnsMock::dns_get_record('example.com', \DNS_A | \DNS_PTR));
146+
$this->assertSame([$ptr], DnsMock::dns_get_record('example.com', \DNS_PTR));
147147
}
148148
}

‎src/Symfony/Bridge/PhpUnit/Tests/ExpectDeprecationTraitTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/Tests/ExpectDeprecationTraitTest.php
+10-10Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class ExpectDeprecationTraitTest extends TestCase
2626
public function testOne()
2727
{
2828
$this->expectDeprecation('foo');
29-
@trigger_error('foo', E_USER_DEPRECATED);
29+
@trigger_error('foo', \E_USER_DEPRECATED);
3030
}
3131

3232
/**
@@ -38,7 +38,7 @@ public function testOne()
3838
public function testOneInIsolation()
3939
{
4040
$this->expectDeprecation('foo');
41-
@trigger_error('foo', E_USER_DEPRECATED);
41+
@trigger_error('foo', \E_USER_DEPRECATED);
4242
}
4343

4444
/**
@@ -50,8 +50,8 @@ public function testMany()
5050
{
5151
$this->expectDeprecation('foo');
5252
$this->expectDeprecation('bar');
53-
@trigger_error('foo', E_USER_DEPRECATED);
54-
@trigger_error('bar', E_USER_DEPRECATED);
53+
@trigger_error('foo', \E_USER_DEPRECATED);
54+
@trigger_error('bar', \E_USER_DEPRECATED);
5555
}
5656

5757
/**
@@ -64,8 +64,8 @@ public function testMany()
6464
public function testOneWithAnnotation()
6565
{
6666
$this->expectDeprecation('bar');
67-
@trigger_error('foo', E_USER_DEPRECATED);
68-
@trigger_error('bar', E_USER_DEPRECATED);
67+
@trigger_error('foo', \E_USER_DEPRECATED);
68+
@trigger_error('bar', \E_USER_DEPRECATED);
6969
}
7070

7171
/**
@@ -80,9 +80,9 @@ public function testManyWithAnnotation()
8080
{
8181
$this->expectDeprecation('ccc');
8282
$this->expectDeprecation('fcy');
83-
@trigger_error('foo', E_USER_DEPRECATED);
84-
@trigger_error('bar', E_USER_DEPRECATED);
85-
@trigger_error('ccc', E_USER_DEPRECATED);
86-
@trigger_error('fcy', E_USER_DEPRECATED);
83+
@trigger_error('foo', \E_USER_DEPRECATED);
84+
@trigger_error('bar', \E_USER_DEPRECATED);
85+
@trigger_error('ccc', \E_USER_DEPRECATED);
86+
@trigger_error('fcy', \E_USER_DEPRECATED);
8787
}
8888
}

‎src/Symfony/Bridge/PhpUnit/Tests/ExpectedDeprecationAnnotationTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/Tests/ExpectedDeprecationAnnotationTest.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class ExpectedDeprecationAnnotationTest extends TestCase
2424
*/
2525
public function testOne()
2626
{
27-
@trigger_error('foo', E_USER_DEPRECATED);
27+
@trigger_error('foo', \E_USER_DEPRECATED);
2828
}
2929

3030
/**
@@ -37,7 +37,7 @@ public function testOne()
3737
*/
3838
public function testMany()
3939
{
40-
@trigger_error('foo', E_USER_DEPRECATED);
41-
@trigger_error('bar', E_USER_DEPRECATED);
40+
@trigger_error('foo', \E_USER_DEPRECATED);
41+
@trigger_error('bar', \E_USER_DEPRECATED);
4242
}
4343
}

‎src/Symfony/Bridge/PhpUnit/Tests/FailTests/ExpectDeprecationTraitTestFail.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/Tests/FailTests/ExpectDeprecationTraitTestFail.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ final class ExpectDeprecationTraitTestFail extends TestCase
3232
public function testOne()
3333
{
3434
$this->expectDeprecation('foo');
35-
@trigger_error('bar', E_USER_DEPRECATED);
35+
@trigger_error('bar', \E_USER_DEPRECATED);
3636
}
3737

3838
/**
@@ -44,6 +44,6 @@ public function testOne()
4444
public function testOneInIsolation()
4545
{
4646
$this->expectDeprecation('foo');
47-
@trigger_error('bar', E_USER_DEPRECATED);
47+
@trigger_error('bar', \E_USER_DEPRECATED);
4848
}
4949
}

‎src/Symfony/Bridge/PhpUnit/Tests/ProcessIsolationTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/Tests/ProcessIsolationTest.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ProcessIsolationTest extends TestCase
1818
*/
1919
public function testIsolation()
2020
{
21-
@trigger_error('Test abc', E_USER_DEPRECATED);
21+
@trigger_error('Test abc', \E_USER_DEPRECATED);
2222
$this->addToAssertionCount(1);
2323
}
2424

@@ -27,6 +27,6 @@ public function testCallingOtherErrorHandler()
2727
$this->expectException('PHPUnit\Framework\Exception');
2828
$this->expectExceptionMessage('Test that PHPUnit\'s error handler fires.');
2929

30-
trigger_error('Test that PHPUnit\'s error handler fires.', E_USER_WARNING);
30+
trigger_error('Test that PHPUnit\'s error handler fires.', \E_USER_WARNING);
3131
}
3232
}

‎src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php
+24-24Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
return null;
3131
}
3232
if (is_dir($probableConfig)) {
33-
return $getPhpUnitConfig($probableConfig.DIRECTORY_SEPARATOR.'phpunit.xml');
33+
return $getPhpUnitConfig($probableConfig.\DIRECTORY_SEPARATOR.'phpunit.xml');
3434
}
3535

3636
if (file_exists($probableConfig)) {
@@ -93,27 +93,27 @@
9393
}
9494
};
9595

96-
if (PHP_VERSION_ID >= 80000) {
96+
if (\PHP_VERSION_ID >= 80000) {
9797
// PHP 8 requires PHPUnit 9.3+
9898
$PHPUNIT_VERSION = $getEnvVar('SYMFONY_PHPUNIT_VERSION', '9.3');
99-
} elseif (PHP_VERSION_ID >= 70200) {
99+
} elseif (\PHP_VERSION_ID >= 70200) {
100100
// PHPUnit 8 requires PHP 7.2+
101101
$PHPUNIT_VERSION = $getEnvVar('SYMFONY_PHPUNIT_VERSION', '8.3');
102-
} elseif (PHP_VERSION_ID >= 70100) {
102+
} elseif (\PHP_VERSION_ID >= 70100) {
103103
// PHPUnit 7 requires PHP 7.1+
104104
$PHPUNIT_VERSION = $getEnvVar('SYMFONY_PHPUNIT_VERSION', '7.5');
105-
} elseif (PHP_VERSION_ID >= 70000) {
105+
} elseif (\PHP_VERSION_ID >= 70000) {
106106
// PHPUnit 6 requires PHP 7.0+
107107
$PHPUNIT_VERSION = $getEnvVar('SYMFONY_PHPUNIT_VERSION', '6.5');
108-
} elseif (PHP_VERSION_ID >= 50600) {
108+
} elseif (\PHP_VERSION_ID >= 50600) {
109109
// PHPUnit 4 does not support PHP 7
110110
$PHPUNIT_VERSION = $getEnvVar('SYMFONY_PHPUNIT_VERSION', '5.7');
111111
} else {
112112
// PHPUnit 5.1 requires PHP 5.6+
113113
$PHPUNIT_VERSION = '4.8';
114114
}
115115

116-
$PHPUNIT_REMOVE_RETURN_TYPEHINT = filter_var($getEnvVar('SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT', '0'), FILTER_VALIDATE_BOOLEAN);
116+
$PHPUNIT_REMOVE_RETURN_TYPEHINT = filter_var($getEnvVar('SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT', '0'), \FILTER_VALIDATE_BOOLEAN);
117117

118118
$COMPOSER_JSON = getenv('COMPOSER') ?: 'composer.json';
119119

@@ -127,9 +127,9 @@
127127

128128
$oldPwd = getcwd();
129129
$PHPUNIT_DIR = $getEnvVar('SYMFONY_PHPUNIT_DIR', $root.'/vendor/bin/.phpunit');
130-
$PHP = defined('PHP_BINARY') ? PHP_BINARY : 'php';
130+
$PHP = defined('PHP_BINARY') ? \PHP_BINARY : 'php';
131131
$PHP = escapeshellarg($PHP);
132-
if ('phpdbg' === PHP_SAPI) {
132+
if ('phpdbg' === \PHP_SAPI) {
133133
$PHP .= ' -qrr';
134134
}
135135

@@ -148,24 +148,24 @@
148148
}
149149

150150
$COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar')
151-
|| ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar`) : `which composer.phar 2> /dev/null`))
152-
|| ($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer`) : `which composer 2> /dev/null`))
153-
|| file_exists($COMPOSER = rtrim('\\' === DIRECTORY_SEPARATOR ? `git rev-parse --show-toplevel 2> NUL` : `git rev-parse --show-toplevel 2> /dev/null`).DIRECTORY_SEPARATOR.'composer.phar')
151+
|| ($COMPOSER = rtrim('\\' === \DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar`) : `which composer.phar 2> /dev/null`))
152+
|| ($COMPOSER = rtrim('\\' === \DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer`) : `which composer 2> /dev/null`))
153+
|| file_exists($COMPOSER = rtrim('\\' === \DIRECTORY_SEPARATOR ? `git rev-parse --show-toplevel 2> NUL` : `git rev-parse --show-toplevel 2> /dev/null`).\DIRECTORY_SEPARATOR.'composer.phar')
154154
? ('#!/usr/bin/env php' === file_get_contents($COMPOSER, false, null, 0, 18) ? $PHP : '').' '.escapeshellarg($COMPOSER) // detect shell wrappers by looking at the shebang
155155
: 'composer';
156156

157157
$SYMFONY_PHPUNIT_REMOVE = $getEnvVar('SYMFONY_PHPUNIT_REMOVE', 'phpspec/prophecy'.($PHPUNIT_VERSION < 6.0 ? ' symfony/yaml' : ''));
158-
$configurationHash = md5(implode(PHP_EOL, [md5_file(__FILE__), $SYMFONY_PHPUNIT_REMOVE, (int) $PHPUNIT_REMOVE_RETURN_TYPEHINT]));
158+
$configurationHash = md5(implode(\PHP_EOL, [md5_file(__FILE__), $SYMFONY_PHPUNIT_REMOVE, (int) $PHPUNIT_REMOVE_RETURN_TYPEHINT]));
159159
$PHPUNIT_VERSION_DIR = sprintf('phpunit-%s-%d', $PHPUNIT_VERSION, $PHPUNIT_REMOVE_RETURN_TYPEHINT);
160160
if (!file_exists("$PHPUNIT_DIR/$PHPUNIT_VERSION_DIR/phpunit") || $configurationHash !== @file_get_contents("$PHPUNIT_DIR/.$PHPUNIT_VERSION_DIR.md5")) {
161161
// Build a standalone phpunit without symfony/yaml nor prophecy by default
162162

163163
@mkdir($PHPUNIT_DIR, 0777, true);
164164
chdir($PHPUNIT_DIR);
165165
if (file_exists("$PHPUNIT_VERSION_DIR")) {
166-
passthru(sprintf('\\' === DIRECTORY_SEPARATOR ? 'rmdir /S /Q %s > NUL' : 'rm -rf %s', "$PHPUNIT_VERSION_DIR.old"));
166+
passthru(sprintf('\\' === \DIRECTORY_SEPARATOR ? 'rmdir /S /Q %s > NUL' : 'rm -rf %s', "$PHPUNIT_VERSION_DIR.old"));
167167
rename("$PHPUNIT_VERSION_DIR", "$PHPUNIT_VERSION_DIR.old");
168-
passthru(sprintf('\\' === DIRECTORY_SEPARATOR ? 'rmdir /S /Q %s' : 'rm -rf %s', "$PHPUNIT_VERSION_DIR.old"));
168+
passthru(sprintf('\\' === \DIRECTORY_SEPARATOR ? 'rmdir /S /Q %s' : 'rm -rf %s', "$PHPUNIT_VERSION_DIR.old"));
169169
}
170170

171171
$info = [];
@@ -216,23 +216,23 @@
216216
$passthruOrFail("$COMPOSER require --no-update phpunit/phpunit-mock-objects \"~3.1.0\"");
217217
}
218218

219-
if (preg_match('{\^((\d++\.)\d++)[\d\.]*$}', $info['requires']['php'], $phpVersion) && version_compare($phpVersion[2].'99', PHP_VERSION, '<')) {
219+
if (preg_match('{\^((\d++\.)\d++)[\d\.]*$}', $info['requires']['php'], $phpVersion) && version_compare($phpVersion[2].'99', \PHP_VERSION, '<')) {
220220
$passthruOrFail("$COMPOSER config platform.php \"$phpVersion[1].99\"");
221221
} else {
222222
$passthruOrFail("$COMPOSER config --unset platform.php");
223223
}
224224
if (file_exists($path = $root.'/vendor/symfony/phpunit-bridge')) {
225225
$passthruOrFail("$COMPOSER require --no-update symfony/phpunit-bridge \"*@dev\"");
226-
$passthruOrFail("$COMPOSER config repositories.phpunit-bridge path ".escapeshellarg(str_replace('/', DIRECTORY_SEPARATOR, $path)));
227-
if ('\\' === DIRECTORY_SEPARATOR) {
226+
$passthruOrFail("$COMPOSER config repositories.phpunit-bridge path ".escapeshellarg(str_replace('/', \DIRECTORY_SEPARATOR, $path)));
227+
if ('\\' === \DIRECTORY_SEPARATOR) {
228228
file_put_contents('composer.json', preg_replace('/^( {8})"phpunit-bridge": \{$/m', "$0\n$1 ".'"options": {"symlink": false},', file_get_contents('composer.json')));
229229
}
230230
} else {
231231
$passthruOrFail("$COMPOSER require --no-update symfony/phpunit-bridge \"*\"");
232232
}
233233
$prevRoot = getenv('COMPOSER_ROOT_VERSION');
234234
putenv("COMPOSER_ROOT_VERSION=$PHPUNIT_VERSION.99");
235-
$q = '\\' === DIRECTORY_SEPARATOR ? '"' : '';
235+
$q = '\\' === \DIRECTORY_SEPARATOR ? '"' : '';
236236
// --no-suggest is not in the list to keep compat with composer 1.0, which is shipped with Ubuntu 16.04LTS
237237
$exit = proc_close(proc_open("$q$COMPOSER install --no-dev --prefer-dist --no-progress $q", [], $p, getcwd()));
238238
putenv('COMPOSER_ROOT_VERSION'.(false !== $prevRoot ? '='.$prevRoot : ''));
@@ -245,12 +245,12 @@
245245
if ($PHPUNIT_REMOVE_RETURN_TYPEHINT) {
246246
$alteredCode = preg_replace('/^ ((?:protected|public)(?: static)? function \w+\(\)): void/m', ' $1', $alteredCode);
247247
}
248-
$alteredCode = preg_replace('/abstract class (?:TestCase|PHPUnit_Framework_TestCase)[^\{]+\{/', '$0 '.PHP_EOL." use \Symfony\Bridge\PhpUnit\Legacy\PolyfillTestCaseTrait;", $alteredCode, 1);
248+
$alteredCode = preg_replace('/abstract class (?:TestCase|PHPUnit_Framework_TestCase)[^\{]+\{/', '$0 '.\PHP_EOL." use \Symfony\Bridge\PhpUnit\Legacy\PolyfillTestCaseTrait;", $alteredCode, 1);
249249
file_put_contents($alteredFile, $alteredCode);
250250

251251
// Mutate Assert code
252252
$alteredCode = file_get_contents($alteredFile = './src/Framework/Assert.php');
253-
$alteredCode = preg_replace('/abstract class (?:Assert|PHPUnit_Framework_Assert)[^\{]+\{/', '$0 '.PHP_EOL." use \Symfony\Bridge\PhpUnit\Legacy\PolyfillAssertTrait;", $alteredCode, 1);
253+
$alteredCode = preg_replace('/abstract class (?:Assert|PHPUnit_Framework_Assert)[^\{]+\{/', '$0 '.\PHP_EOL." use \Symfony\Bridge\PhpUnit\Legacy\PolyfillAssertTrait;", $alteredCode, 1);
254254
file_put_contents($alteredFile, $alteredCode);
255255

256256
file_put_contents('phpunit', <<<'EOPHP'
@@ -303,7 +303,7 @@ class SymfonyExcludeListPhpunit {}
303303

304304
return false;
305305
});
306-
} elseif (filter_var(getenv('SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE'), FILTER_VALIDATE_BOOLEAN)) {
306+
} elseif (filter_var(getenv('SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE'), \FILTER_VALIDATE_BOOLEAN)) {
307307
$argv[] = '--do-not-cache-result';
308308
++$argc;
309309
}
@@ -335,7 +335,7 @@ class SymfonyExcludeListPhpunit {}
335335
$cmd[0] = sprintf('%s %s --colors=always', $PHP, escapeshellarg("$PHPUNIT_DIR/$PHPUNIT_VERSION_DIR/phpunit"));
336336
$cmd = str_replace('%', '%%', implode(' ', $cmd)).' %1$s';
337337

338-
if ('\\' === DIRECTORY_SEPARATOR) {
338+
if ('\\' === \DIRECTORY_SEPARATOR) {
339339
$cmd = 'cmd /v:on /d /c "('.$cmd.')%2$s"';
340340
} else {
341341
$cmd .= '%2$s';
@@ -385,7 +385,7 @@ class SymfonyExcludeListPhpunit {}
385385
// STATUS_STACK_BUFFER_OVERRUN (-1073740791/0xC0000409)
386386
// STATUS_ACCESS_VIOLATION (-1073741819/0xC0000005)
387387
// STATUS_HEAP_CORRUPTION (-1073740940/0xC0000374)
388-
if ($procStatus && ('\\' !== DIRECTORY_SEPARATOR || !extension_loaded('apcu') || !filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN) || !in_array($procStatus, [-1073740791, -1073741819, -1073740940]))) {
388+
if ($procStatus && ('\\' !== \DIRECTORY_SEPARATOR || !extension_loaded('apcu') || !filter_var(ini_get('apc.enable_cli'), \FILTER_VALIDATE_BOOLEAN) || !in_array($procStatus, [-1073740791, -1073741819, -1073740940]))) {
389389
$exit = $procStatus;
390390
echo "\033[41mKO\033[0m $component\n\n";
391391
} else {

‎src/Symfony/Bridge/PhpUnit/bootstrap.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/bootstrap.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class_alias('PHPUnit_Framework_Constraint_Xor', 'PHPUnit\Framework\Constraint\Lo
115115
}
116116

117117
// Enforce a consistent locale
118-
setlocale(LC_ALL, 'C');
118+
setlocale(\LC_ALL, 'C');
119119

120120
if (!class_exists('Doctrine\Common\Annotations\AnnotationRegistry', false) && class_exists('Doctrine\Common\Annotations\AnnotationRegistry')) {
121121
if (method_exists('Doctrine\Common\Annotations\AnnotationRegistry', 'registerUniqueLoader')) {

‎src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/LazyLoadingValueHolderGenerator.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/LazyLoadingValueHolderGenerator.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function generate(\ReflectionClass $originalClass, ClassGenerator $classG
6666
if (null !== $docBlock = $method->getDocBlock()) {
6767
$code = substr($code, \strlen($docBlock->generate()));
6868
}
69-
$refAmp = (strpos($code, '&') ?: PHP_INT_MAX) <= strpos($code, '(') ? '&' : '';
69+
$refAmp = (strpos($code, '&') ?: \PHP_INT_MAX) <= strpos($code, '(') ? '&' : '';
7070
$body = preg_replace(
7171
'/\nreturn (\$this->valueHolder[0-9a-f]++)(->[^;]++);$/',
7272
"\nif ($1 === \$returnValue = {$refAmp}$1$2) {\n \$returnValue = \$this;\n}\n\nreturn \$returnValue;",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.