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

Skip to content

Commit b514323

Browse files
Merge branch '3.4' into 4.0
* 3.4: Enable native_constant_invocation CS fixer
2 parents 7e01f9b + f569f58 commit b514323

File tree

92 files changed

+407
-409
lines changed

Some content is hidden

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

92 files changed

+407
-409
lines changed

.php_cs.dist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ return PhpCsFixer\Config::create()
1313
'array_syntax' => array('syntax' => 'long'),
1414
'ordered_imports' => true,
1515
'protected_to_private' => false,
16-
// TODO remove the disabling once https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/3876 is merged and released
17-
'native_constant_invocation' => false,
1816
// Part of @Symfony:risky in PHP-CS-Fixer 2.13.0. To be removed from the config file once upgrading
1917
'native_function_invocation' => array('include' => array('@compiler_optimized'), 'scope' => 'namespaced'),
2018
))

src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class DoctrineExtractorTest extends TestCase
3030

3131
protected function setUp()
3232
{
33-
$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures'), true);
33+
$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures'), true);
3434
$entityManager = EntityManager::create(array('driver' => 'pdo_sqlite'), $config);
3535

3636
if (!DBALType::hasType('foo')) {

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public static function register($mode = 0)
8080
return true;
8181
}
82 10000 82
foreach ($vendors as $vendor) {
83-
if (0 === strpos($realPath, $vendor) && false !== strpbrk(substr($realPath, \strlen($vendor), 1), '/'.DIRECTORY_SEPARATOR)) {
83+
if (0 === strpos($realPath, $vendor) && false !== strpbrk(substr($realPath, \strlen($vendor), 1), '/'.\DIRECTORY_SEPARATOR)) {
8484
return true;
8585
}
8686
}
@@ -159,7 +159,7 @@ public static function register($mode = 0)
159159
echo "\n".ucfirst($group).' deprecation triggered by '.$class.'::'.$method.':';
160160
echo "\n".$msg;
161161
echo "\nStack trace:";
162-
echo "\n".str_replace(' '.getcwd().DIRECTORY_SEPARATOR, ' ', $e->getTraceAsString());
162+
echo "\n".str_replace(' '.getcwd().\DIRECTORY_SEPARATOR, ' ', $e->getTraceAsString());
163163
echo "\n";
164164

165165
exit(1);
@@ -315,7 +315,7 @@ private static function hasColorSupport()
315315
return true;
316316
}
317317

318-
if (DIRECTORY_SEPARATOR === '\\') {
318+
if (\DIRECTORY_SEPARATOR === '\\') {
319319
return (\function_exists('sapi_windows_vt100_support')
320320
&& sapi_windows_vt100_support(STDOUT))
321321
|| false !== getenv('ANSICON')

src/Symfony/Bridge/Twig/Command/DebugCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
116116
}
117117
$firstNamespace = false;
118118
foreach ($paths as $path) {
119-
$rows[] = array($namespace, $path.DIRECTORY_SEPARATOR);
119+
$rows[] = array($namespace, $path.\DIRECTORY_SEPARATOR);
120120
$namespace = '';
121121
}
122122
if (\count($paths) > 1) {
@@ -145,7 +145,7 @@ private function getLoaderPaths()
145145
foreach ($loader->getNamespaces() as $namespace) {
146146
$paths = array_map(function ($path) {
147147
if (null !== $this->projectDir && 0 === strpos($path, $this->projectDir)) {
148-
$path = ltrim(substr($path, \strlen($this->projectDir)), DIRECTORY_SEPARATOR);
148+
$path = ltrim(substr($path, \strlen($this->projectDir)), \DIRECTORY_SEPARATOR);
149149
}
150150

151151
return $path;

src/Symfony/Bridge/Twig/Extension/CodeExtension.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class CodeExtension extends AbstractExtension
3434
public function __construct($fileLinkFormat, string $rootDir, string $charset)
3535
{
3636
$this->fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
37-
$this->rootDir = str_replace('/', DIRECTORY_SEPARATOR, \dirname($rootDir)).DIRECTORY_SEPARATOR;
37+
$this->rootDir = str_replace('/', \DIRECTORY_SEPARATOR, \dirname($rootDir)).\DIRECTORY_SEPARATOR;
3838
$this->charset = $charset;
3939
}
4040

@@ -173,11 +173,11 @@ public function formatFile($file, $line, $text = null)
173173
$file = trim($file);
174174

175175
if (null === $text) {
176-
$text = str_replace('/', DIRECTORY_SEPARATOR, $file);
176+
$text = str_replace('/', \DIRECTORY_SEPARATOR, $file);
177177
if (0 === strpos($text, $this->rootDir)) {
178178
$text = substr($text, \strlen($this->rootDir));
179-
$text = explode(DIRECTORY_SEPARATOR, $text, 2);
180-
$text = sprintf('<abbr title="%s%2$s">%s</abbr>%s', $this->rootDir, $text[0], isset($text[1]) ? DIRECTORY_SEPARATOR.$text[1] : '');
179+
$text = explode(\DIRECTORY_SEPARATOR, $text, 2);
180+
$text = sprintf('<abbr title="%s%2$s">%s</abbr>%s', $this->rootDir, $text[0], isset($text[1]) ? \DIRECTORY_SEPARATOR.$text[1] : '');
181181
}
182182
}
183183

src/Symfony/Bridge/Twig/Tests/Command/DebugCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function testLineSeparatorInLoaderPaths()
3939
FilesystemLoader::MAIN_NAMESPACE => array('extractor', 'extractor'),
4040
));
4141
$ret = $tester->execute(array(), array('decorated' => false));
42-
$ds = DIRECTORY_SEPARATOR;
42+
$ds = \DIRECTORY_SEPARATOR;
4343
$loaderPaths = <<<TXT
4444
Loader Paths
4545
------------

src/Symfony/Bridge/Twig/Tests/Translation/TwigExtractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function testExtractSyntaxError($resources)
9090
$extractor->extract($resources, new MessageCatalogue('en'));
9191
} catch (Error $e) {
9292
if (method_exists($e, 'getSourceContext')) {
93-
$this->assertSame(\dirname(__DIR__).strtr('/Fixtures/extractor/syntax_error.twig', '/', DIRECTORY_SEPARATOR), $e->getFile());
93+
$this->assertSame(\dirname(__DIR__).strtr('/Fixtures/extractor/syntax_error.twig', '/', \DIRECTORY_SEPARATOR), $e->getFile());
9494
$this->assertSame(1, $e->getLine());
9595
$this->assertSame('Unclosed "block".', $e->getMessage());
9696
} else {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
153153
}
154154

155155
if ($method === $expectedMethod) {
156-
$rows[] = array(sprintf('<fg=green;options=bold>%s</>', '\\' === DIRECTORY_SEPARATOR ? 'OK' : "\xE2\x9C\x94" /* HEAVY CHECK MARK (U+2714) */), $message, $method);
156+
$rows[] = array(sprintf('<fg=green;options=bold>%s</>', '\\' === \DIRECTORY_SEPARATOR ? 'OK' : "\xE2\x9C\x94" /* HEAVY CHECK MARK (U+2714) */), $message, $method);
157157
} else {
158-
$rows[] = array(sprintf('<fg=yellow;options=bold>%s</>', '\\' === DIRECTORY_SEPARATOR ? 'WARNING' : '!'), $message, $method);
158+
$rows[] = array(sprintf('<fg=yellow;options=bold>%s</>', '\\' === \DIRECTORY_SEPARATOR ? 'WARNING' : '!'), $message, $method);
159159
}
160160
} catch (\Exception $e) {
161161
$exitCode = 1;
162-
$rows[] = array(sprintf('<fg=red;options=bold>%s</>', '\\' === DIRECTORY_SEPARATOR ? 'ERROR' : "\xE2\x9C\x98" /* HEAVY BALLOT X (U+2718) */), $message, $e->getMessage());
162+
$rows[] = array(sprintf('<fg=red;options=bold>%s</>', '\\' === \DIRECTORY_SEPARATOR ? 'ERROR' : "\xE2\x9C\x98" /* HEAVY BALLOT X (U+2718) */), $message, $e->getMessage());
163163
}
164164
}
165165
// remove the assets of the bundles that no longer exist

src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplatePathsCacheWarmerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected function setUp()
5050

5151
$this->templateLocator = new TemplateLocator($this->fileLocator);
5252

53-
$this->tmpDir = sys_get_temp_dir().DIRECTORY_SEPARATOR.uniqid('cache_template_paths_', true);
53+
$this->tmpDir = sys_get_temp_dir().\DIRECTORY_SEPARATOR.uniqid('cache_template_paths_', true);
5454

5555
$this->filesystem = new Filesystem();
5656
$this->filesystem->mkdir($this->tmpDir);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function setUp()
3333
{
3434
$this->fs = new Filesystem();
3535
$this->kernel = new TestAppKernel('test', true);
36-
$this->rootDir = sys_get_temp_dir().DIRECTORY_SEPARATOR.uniqid('sf2_cache_', true);
36+
$this->rootDir = sys_get_temp_dir().\DIRECTORY_SEPARATOR.uniqid('sf2_cache_', true);
3737
$this->kernel->setRootDir($this->rootDir);
3838
$this->fs->mkdir($this->rootDir);
3939
}
@@ -83,7 +83,7 @@ public function testCacheIsFreshAfterCacheClearedWithWarmup()
8383
$this->assertTrue($found, 'Kernel file should present as resource');
8484

8585
$containerRef = new \ReflectionClass(require $containerFile);
86-
$containerFile = str_replace('tes_'.DIRECTORY_SEPARATOR, 'test'.DIRECTORY_SEPARATOR, $containerRef->getFileName());
86+
$containerFile = str_replace('tes_'.\DIRECTORY_SEPARATOR, 'test'.\DIRECTORY_SEPARATOR, $containerRef->getFileName());
8787
$this->assertRegExp(sprintf('/\'kernel.container_class\'\s*=>\s*\'%s\'/', $containerClass), file_get_contents($containerFile), 'kernel.container_class is properly set on the dumped container');
8888
}
8989
}

src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/TestAppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function setRootDir($rootDir)
3333

3434
public function registerContainerConfiguration(LoaderInterface $loader)
3535
{
36-
$loader->load(__DIR__.DIRECTORY_SEPARATOR.'config.yml');
36+
$loader->load(__DIR__.\DIRECTORY_SEPARATOR.'config.yml');
3737
}
3838

3939
protected function build(ContainerBuilder $container)

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -494,29 +494,29 @@ public function testTranslator()
494494
$files = array_map('realpath', $options['resource_files']['en']);
495495
$ref = new \ReflectionClass('Symfony\Component\Validator\Validation');
496496
$this->assertContains(
497-
strtr(\dirname($ref->getFileName()).'/Resources/translations/validators.en.xlf', '/', DIRECTORY_SEPARATOR),
497+
strtr(\dirname($ref->getFileName()).'/Resources/translations/validators.en.xlf', '/', \DIRECTORY_SEPARATOR),
498498
$files,
499499
'->registerTranslatorConfiguration() finds Validator translation resources'
500500
);
501501
$ref = new \ReflectionClass('Symfony\Component\Form\Form');
502502
$this->assertContains(
503-
strtr(\dirname($ref->getFileName()).'/Resources/translations/validators.en.xlf', '/', DIRECTORY_SEPARATOR),
503+
strtr(\dirname($ref->getFileName()).'/Resources/translations/validators.en.xlf', '/', \DIRECTORY_SEPARATOR),
504504
$files,
505505
'->registerTranslatorConfiguration() finds Form translation resources'
506506
);
507507
$ref = new \ReflectionClass('Symfony\Component\Security\Core\Security');
508508
$this->assertContains(
509-
strtr(\dirname($ref->getFileName()).'/Resources/translations/security.en.xlf', '/', DIRECTORY_SEPARATOR),
509+
strtr(\dirname($ref->getFileName()).'/Resources/translations/security.en.xlf', '/', \DIRECTORY_SEPARATOR),
510510
$files,
511511
'->registerTranslatorConfiguration() finds Security translation resources'
512512
);
513513
$this->assertContains(
514-
strtr(__DIR__.'/Fixtures/translations/test_paths.en.yml', '/', DIRECTORY_SEPARATOR),
514+
strtr(__DIR__.'/Fixtures/translations/test_paths.en.yml', '/', \DIRECTORY_SEPARATOR),
515515
$files,
516516
'->registerTranslatorConfiguration() finds translation resources in custom paths'
517517
);
518518
$this->assertContains(
519-
strtr(__DIR__.'/translations/test_default.en.xlf', '/', DIRECTORY_SEPARATOR),
519+
strtr(__DIR__.'/translations/test_default.en.xlf', '/', \DIRECTORY_SEPARATOR),
520520
$files,
521521
'->registerTranslatorConfiguration() finds translation resources in default path'
522522
);
@@ -565,7 +565,7 @@ public function testValidation()
565565
$ref = new \ReflectionClass('Symfony\Component\Form\Form');
566566
$xmlMappings = array(
567567
\dirname($ref->getFileName()).'/Resources/config/validation.xml',
568-
strtr($projectDir.'/config/validator/foo.xml', '/', DIRECTORY_SEPARATOR),
568+
strtr($projectDir.'/config/validator/foo.xml', '/', \DIRECTORY_SEPARATOR),
569569
);
570570

571571
$calls = $container->getDefinition('validator.builder')->getMethodCalls();
@@ -659,10 +659,10 @@ public function testValidationPaths()
659659
$this->assertCount(3, $xmlMappings);
660660
try {
661661
// Testing symfony/symfony
662-
$this->assertStringEndsWith('Component'.DIRECTORY_SEPARATOR.'Form/Resources/config/validation.xml', $xmlMappings[0]);
662+
$this->assertStringEndsWith('Component'.\DIRECTORY_SEPARATOR.'Form/Resources/config/validation.xml', $xmlMappings[0]);
663663
} catch (\Exception $e) {
664664
// Testing symfony/framework-bundle with deps=high
665-
$this->assertStringEndsWith('symfony'.DIRECTORY_SEPARATOR.'form/Resources/config/validation.xml', $xmlMappings[0]);
665+
$this->assertStringEndsWith('symfony'.\DIRECTORY_SEPARATOR.'form/Resources/config/validation.xml', $xmlMappings[0]);
666666
}
667667
$this->assertStringEndsWith('TestBundle/Resources/config/validation.xml', $xmlMappings[1]);
668668

@@ -686,10 +686,10 @@ public function testValidationPathsUsingCustomBundlePath()
686686

687687
try {
688688
// Testing symfony/symfony
689-
$this->assertStringEndsWith('Component'.DIRECTORY_SEPARATOR.'Form/Resources/config/validation.xml', $xmlMappings[0]);
689+
$this->assertStringEndsWith('Component'.\DIRECTORY_SEPARATOR.'Form/Resources/config/validation.xml', $xmlMappings[0]);
690690
} catch (\Exception $e) {
691691
// Testing symfony/framework-bundle with deps=high
692-
$this->assertStringEndsWith('symfony'.DIRECTORY_SEPARATOR.'form/Resources/config/validation.xml', $xmlMappings[0]);
692+
$this->assertStringEndsWith('symfony'.\DIRECTORY_SEPARATOR.'form/Resources/config/validation.xml', $xmlMappings[0]);
693693
}
694694
$this->assertStringEndsWith('CustomPathBundle/Resources/config/validation.xml', $xmlMappings[1]);
695695

@@ -899,15 +899,15 @@ public function testSerializerMapping()
899899

900900
foreach ($expectedLoaders as $definition) {
901901
if (is_file($arg = $definition->getArgument(0))) {
902-
$definition->replaceArgument(0, strtr($arg, '/', DIRECTORY_SEPARATOR));
902+
$definition->replaceArgument(0, strtr($arg, '/', \DIRECTORY_SEPARATOR));
903903
}
904904
$definition->setPublic(false);
905905
}
906906

907907
$loaders = $container->getDefinition('serializer.mapping.chain_loader')->getArgument(0);
908908
foreach ($loaders as $loader) {
909909
if (is_file($arg = $loader->getArgument(0))) {
910-
$loader->replaceArgument(0, strtr($arg, '/', DIRECTORY_SEPARATOR));
910+
$loader->replaceArgument(0, strtr($arg, '/', \DIRECTORY_SEPARATOR));
911911
}
912912
}
913913
$this->assertEquals($expectedLoaders, $loaders);

src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ public function openAction(Request $request)
366366
$file = $request->query->get('file');
367367
$line = $request->query->get('line');
368368

369-
$filename = $this->baseDir.DIRECTORY_SEPARATOR.$file;
369+
$filename = $this->baseDir.\DIRECTORY_SEPARATOR.$file;
370370

371371
if (preg_match("'(^|[/\\\\])\.'", $file) || !is_readable($filename)) {
372372
throw new NotFoundHttpException(sprintf('The file "%s" cannot be opened.', $file));

src/Symfony/Component/Cache/Tests/Adapter/ApcuAdapterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ public function createCachePool($defaultLifetime = 0)
2727
if (!\function_exists('apcu_fetch') || !ini_get('apc.enabled')) {
2828
$this->markTestSkipped('APCu extension is required.');
2929
}
30-
if ('cli' === PHP_SAPI && !ini_get('apc.enable_cli')) {
30+
if ('cli' === \PHP_SAPI && !ini_get('apc.enable_cli')) {
3131
if ('testWithCliSapi' !== $this->getName()) {
3232
$this->markTestSkipped('apc.enable_cli=1 is required.');
3333
}
3434
}
35-
if ('\\' === DIRECTORY_SEPARATOR) {
35+
if ('\\' === \DIRECTORY_SEPARATOR) {
3636
$this->markTestSkipped('Fails transiently on Windows.');
3737
}
3838

src/Symfony/Component/Cache/Tests/Simple/ApcuCacheTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ class ApcuCacheTest extends CacheTestCase
2323

2424
public function createSimpleCache($defaultLifetime = 0)
2525
{
26-
if (!\function_exists('apcu_fetch') || !ini_get('apc.enabled') || ('cli' === PHP_SAPI && !ini_get('apc.enable_cli'))) {
26+
if (!\function_exists('apcu_fetch') || !ini_get('apc.enabled') || ('cli' === \PHP_SAPI && !ini_get('apc.enable_cli'))) {
2727
$this->markTestSkipped('APCu extension is required.');
2828
}
29-
if ('\\' === DIRECTORY_SEPARATOR) {
29+
if ('\\' === \DIRECTORY_SEPARATOR) {
3030
$this->markTestSkipped('Fails transiently on Windows.');
3131
}
3232

src/Symfony/Component/Cache/Traits/ApcuTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private function init($namespace, $defaultLifetime, $version)
3131
if (!static::isSupported()) {
3232
throw new CacheException('APCu is not enabled');
3333
}
34-
if ('cli' === PHP_SAPI) {
34+
if ('cli' === \PHP_SAPI) {
3535
ini_set('apc.use_request_time', 0);
3636
}
3737
parent::__construct($namespace, $defaultLifetime);
@@ -75,7 +75,7 @@ protected function doHave($id)
7575
*/
7676
protected function doClear($namespace)
7777
{
78-
return isset($namespace[0]) && class_exists('APCuIterator', false) && ('cli' !== PHP_SAPI || ini_get('apc.enable_cli'))
78+
return isset($namespace[0]) && class_exists('APCuIterator', false) && ('cli' !== \PHP_SAPI || ini_get('apc.enable_cli'))
7979
? apcu_delete(new \APCuIterator(sprintf('/^%s/', preg_quote($namespace, '/')), APC_ITER_KEY))
8080
: apcu_clear_cache();
8181
}

src/Symfony/Component/Cache/Traits/FilesystemCommonTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ private function init($namespace, $directory)
3434
if (preg_match('#[^-+_.A-Za-z0-9]#', $namespace, $match)) {
3535
throw new InvalidArgumentException(sprintf('Namespace contains "%s" but only characters in [-+_.A-Za-z0-9] are allowed.', $match[0]));
3636
}
37-
$directory .= DIRECTORY_SEPARATOR.$namespace;
37+
$directory .= \DIRECTORY_SEPARATOR.$namespace;
3838
}
3939
if (!file_exists($directory)) {
4040
@mkdir($directory, 0777, true);
4141
}
42-
$directory .= DIRECTORY_SEPARATOR;
42+
$directory .= \DIRECTORY_SEPARATOR;
4343
// On Windows the whole path is limited to 258 chars
44-
if ('\\' === DIRECTORY_SEPARATOR && \strlen($directory) > 234) {
44+
if ('\\' === \DIRECTORY_SEPARATOR && \strlen($directory) > 234) {
4545
throw new InvalidArgumentException(sprintf('Cache directory too long (%s)', $directory));
4646
}
4747

@@ -99,7 +99,7 @@ private function write($file, $data, $expiresAt = null)
9999
private function getFile($id, $mkdir = false)
100100
{
101101
$hash = str_replace('/', '-', base64_encode(hash('sha256', static::class.$id, true)));
102-
$dir = $this->directory.strtoupper($hash[0].DIRECTORY_SEPARATOR.$hash[1].DIRECTORY_SEPARATOR);
102+
$dir = $this->directory.strtoupper($hash[0].\DIRECTORY_SEPARATOR.$hash[1].\DIRECTORY_SEPARATOR);
103103

104104
if ($mkdir && !file_exists($dir)) {
105105
@mkdir($dir, 0777, true);

src/Symfony/Component/Cache/Traits/PhpFilesTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function prune()
4040
{
4141
$time = time();
4242
$pruned = true;
43-
$allowCompile = 'cli' !== PHP_SAPI || ini_get('opcache.enable_cli');
43+
$allowCompile = 'cli' !== \PHP_SAPI || ini_get('opcache.enable_cli');
4444

4545
set_error_handler($this->includeHandler);
4646
try {
@@ -119,7 +119,7 @@ protected function doSave(array $values, $lifetime)
119119
{
120120
$ok = true;
121121
$data = array($lifetime ? time() + $lifetime : PHP_INT_MAX, '');
122-
$allowCompile = 'cli' !== PHP_SAPI || ini_get('opcache.enable_cli');
122+
$allowCompile = 'cli' !== \PHP_SAPI || ini_get('opcache.enable_cli');
123123

124124
foreach ($values as $key => $value) {
125125
if (null === $value || \is_object($value)) {

src/Symfony/Component/Config/Exception/FileLoaderLoadException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function __construct(string $resource, string $sourceResource = null, int
5757

5858
// Is the resource located inside a bundle?
5959
if ('@' === $resource[0]) {
60-
$parts = explode(DIRECTORY_SEPARATOR, $resource);
60+
$parts = explode(\DIRECTORY_SEPARATOR, $resource);
6161
$bundle = substr($parts[0], 1);
6262
$message .= sprintf(' Make sure the "%s" bundle is correctly registered and loaded in the application kernel class.', $bundle);
6363
$message .= sprintf(' If the bundle is registered, make sure the bundle path "%s" is not empty.', $resource);

0 commit comments

Comments
 (0)
0