8000 Merge branch '4.1' · symfony/symfony@510977d · GitHub
[go: up one dir, main page]

Skip to content

Commit 510977d

Browse files
Merge branch '4.1'
* 4.1: Enable native_constant_invocation CS fixer
2 parents f51a76c + c4d10c4 commit 510977d

File tree

90 files changed

+372
-374
lines changed

Some content is hidden

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

90 files changed

+372
-374
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/Twig/Command/DebugCommand.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
126126
}
127127
$firstNamespace = false;
128128
foreach ($paths as $path) {
129-
$rows[] = array($namespace, $path.DIRECTORY_SEPARATOR);
129+
$rows[] = array($namespace, $path.\DIRECTORY_SEPARATOR);
130130
$namespace = '';
131131
}
132132
if (\count($paths) > 1) {
@@ -159,7 +159,7 @@ private function getLoaderPaths()
159159
foreach ($loader->getNamespaces() as $namespace) {
160160
$paths = array_map(function ($path) {
161161
if (null !== $this->projectDir && 0 === strpos($path, $this->projectDir)) {
162-
$path = ltrim(substr($path, \strlen($this->projectDir)), DIRECTORY_SEPARATOR);
162+
$path = ltrim(substr($path, \strlen($this->projectDir)), \DIRECTORY_SEPARATOR);
163163
}
164164

165165
return $path;
@@ -272,7 +272,7 @@ private function findWrongBundleOverrides(): array
272272

273273
if ($this->rootDir && $this->projectDir) {
274274
$folders = glob($this->rootDir.'/Resources/*/views', GLOB_ONLYDIR);
275-
$relativePath = ltrim(substr($this->rootDir.'/Resources/', \strlen($this->projectDir)), DIRECTORY_SEPARATOR);
275+
$relativePath = ltrim(substr($this->rootDir.'/Resources/', \strlen($this->projectDir)), \DIRECTORY_SEPARATOR);
276276
$bundleNames = array_reduce(
277277
$folders,
278278
function ($carry, $absolutePath) use ($relativePath) {
@@ -290,13 +290,13 @@ function ($carry, $absolutePath) use ($relativePath) {
290290

291291
if ($this->twigDefaultPath && $this->projectDir) {
292292
$folders = glob($this->twigDefaultPath.'/bundles/*', GLOB_ONLYDIR);
293-
$relativePath = ltrim(substr($this->twigDefaultPath.'/bundles', \strlen($this->projectDir)), DIRECTORY_SEPARATOR);
293+
$relativePath = ltrim(substr($this->twigDefaultPath.'/bundles', \strlen($this->projectDir)), \DIRECTORY_SEPARATOR);
294294
$bundleNames = array_reduce(
295295
$folders,
296296
function ($carry, $absolutePath) use ($relativePath) {
297297
if (0 === strpos($absolutePath, $this->projectDir)) {
298-
$path = ltrim(substr($absolutePath, \strlen($this->projectDir)), DIRECTORY_SEPARATOR);
299-
$name = ltrim(substr($path, \strlen($relativePath)), DIRECTORY_SEPARATOR);
298+
$path = ltrim(substr($absolutePath, \strlen($this->projectDir)), \DIRECTORY_SEPARATOR);
299+
$name = ltrim(substr($path, \strlen($relativePath)), \DIRECTORY_SEPARATOR);
300300
$carry[$name] = $path;
301301
}
302302

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class CodeExtension extends AbstractExtension
3535
public function __construct($fileLinkFormat, string $rootDir, string $charset, string $projectDir = null)
3636
{
3737
$this->fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
38-
$this->rootDir = str_replace('/', DIRECTORY_SEPARATOR, \dirname($rootDir)).DIRECTORY_SEPARATOR;
38+
$this->rootDir = str_replace('/', \DIRECTORY_SEPARATOR, \dirname($rootDir)).\DIRECTORY_SEPARATOR;
3939
$this->charset = $charset;
4040
$this->projectDir = $projectDir;
4141
}
@@ -176,11 +176,11 @@ public function formatFile($file, $line, $text = null)
176176
$file = trim($file);
177177

178178
if (null === $text) {
179-
$text = str_replace('/', DIRECTORY_SEPARATOR, $file);
179+
$text = str_replace('/', \DIRECTORY_SEPARATOR, $file);
180180
if (0 === strpos($text, $this->rootDir)) {
181181
$text = substr($text, \strlen($this->rootDir));
182-
$text = explode(DIRECTORY_SEPARATOR, $text, 2);
183-
$text = sprintf('<abbr title="%s%2$s">%s</abbr>%s', $this->rootDir, $text[0], isset($text[1]) ? DIRECTORY_SEPARATOR.$text[1] : '');
182+
$text = explode(\DIRECTORY_SEPARATOR, $text, 2);
183+
$text = sprintf('<abbr title="%s%2$s">%s</abbr>%s', $this->rootDir, $text[0], isset($text[1]) ? \DIRECTORY_SEPARATOR.$text[1] : '');
184184
}
185185
}
186186

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
@@ -154,13 +154,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
154154
}
155155

156156
if ($method === $expectedMethod) {
157-
$rows[] = array(sprintf('<fg=green;options=bold>%s</>', '\\' === DIRECTORY_SEPARATOR ? 'OK' : "\xE2\x9C\x94" /* HEAVY CHECK MARK (U+2714) */), $message, $method);
157+
$rows[] = array(sprintf('<fg=green;options=bold>%s</>', '\\' === \DIRECTORY_SEPARATOR ? 'OK' : "\xE2\x9C\x94" /* HEAVY CHECK MARK (U+2714) */), $message, $method);
158158
} else {
159-
$rows[] = array(sprintf('<fg=yellow;options=bold>%s</>', '\\' === DIRECTORY_SEPARATOR ? 'WARNING' : '!'), $message, $method);
159+
$rows[] = array(sprintf('<fg=yellow;options=bold>%s</>', '\\' === \DIRECTORY_SEPARATOR ? 'WARNING' : '!'), $message, $method);
160160
}
161161
} catch (\Exception $e) {
162162
$exitCode = 1;
163-
$rows[] = array(sprintf('<fg=red;options=bold>%s</>', '\\' === DIRECTORY_SEPARATOR ? 'ERROR' : "\xE2\x9C\x98" /* HEAVY BALLOT X (U+2718) */), $message, $e->getMessage());
163+
$rows[] = array(sprintf('<fg=red;options=bold>%s</>', '\\' === \DIRECTORY_SEPARATOR ? 'ERROR' : "\xE2\x9C\x98" /* HEAVY BALLOT X (U+2718) */), $message, $e->getMessage());
164164
}
165165
}
166166
// 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
@@ -657,29 +657,29 @@ public function testTranslator()
657657
10000 $files = array_map('realpath', $options['resource_files']['en']);
658658
$ref = new \ReflectionClass('Symfony\Component\Validator\Validation');
659659
$this->assertContains(
660-
strtr(\dirname($ref->getFileName()).'/Resources/translations/validators.en.xlf', '/', DIRECTORY_SEPARATOR),
660+
strtr(\dirname($ref->getFileName()).'/Resources/translations/validators.en.xlf', '/', \DIRECTORY_SEPARATOR),
661661
$files,
662662
'->registerTranslatorConfiguration() finds Validator translation resources'
663663
);
664664
$ref = new \ReflectionClass('Symfony\Component\Form\Form');
665665
$this->assertContains(
666-
strtr(\dirname($ref->getFileName()).'/Resources/translations/validators.en.xlf', '/', DIRECTORY_SEPARATOR),
666+
strtr(\dirname($ref->getFileName()).'/Resources/translations/validators.en.xlf', '/', \DIRECTORY_SEPARATOR),
667667
$files,
668668
'->registerTranslatorConfiguration() finds Form translation resources'
669669
);
670670
$ref = new \ReflectionClass('Symfony\Component\Security\Core\Security');
671671
$this->assertContains(
672-
strtr(\dirname($ref->getFileName()).'/Resources/translations/security.en.xlf', '/', DIRECTORY_SEPARATOR),
672+
strtr(\dirname($ref->getFileName()).'/Resources/translations/security.en.xlf', '/', \DIRECTORY_SEPARATOR),
673673
$files,
674674
'->registerTranslatorConfiguration() finds Security translation resources'
675675
);
676676
$this->assertContains(
677-
strtr(__DIR__.'/Fixtures/translations/test_paths.en.yml', '/', DIRECTORY_SEPARATOR),
677+
strtr(__DIR__.'/Fixtures/translations/test_paths.en.yml', '/', \DIRECTORY_SEPARATOR),
678678
$files,
679679
'->registerTranslatorConfiguration() finds translation resources in custom paths'
680680
);
681681
$this->assertContains(
682-
strtr(__DIR__.'/translations/test_default.en.xlf', '/', DIRECTORY_SEPARATOR),
682+
strtr(__DIR__.'/translations/test_default.en.xlf', '/', \DIRECTORY_SEPARATOR),
683683
$files,
684684
'->registerTranslatorConfiguration() finds translation resources in default path'
685685
);
@@ -728,7 +728,7 @@ public function testValidation()
728728
$ref = new \ReflectionClass('Symfony\Component\Form\Form');
729729
$xmlMappings = array(
730730
\dirname($ref->getFileName()).'/Resources/config/validation.xml',
731-
strtr($projectDir.'/config/validator/foo.xml', '/', DIRECTORY_SEPARATOR),
731+
strtr($projectDir.'/config/validator/foo.xml', '/', \DIRECTORY_SEPARATOR),
732732
);
733733

734734
$calls = $container->getDefinition('validator.builder')->getMethodCalls();
@@ -822,10 +822,10 @@ public function testValidationPaths()
822822
$this->assertCount(3, $xmlMappings);
823823
try {
824824
// Testing symfony/symfony
825-
$this->assertStringEndsWith('Component'.DIRECTORY_SEPARATOR.'Form/Resources/config/validation.xml', $xmlMappings[0]);
825+
$this->assertStringEndsWith('Component'.\DIRECTORY_SEPARATOR.'Form/Resources/config/validation.xml', $xmlMappings[0]);
826826
} catch (\Exception $e) {
827827
// Testing symfony/framework-bundle with deps=high
828-
$this->assertStringEndsWith('symfony'.DIRECTORY_SEPARATOR.'form/Resources/config/validation.xml', $xmlMappings[0]);
828+
$this->assertStringEndsWith('symfony'.\DIRECTORY_SEPARATOR.'form/Resources/config/validation.xml', $xmlMappings[0]);
829829
}
830830
$this->assertStringEndsWith('TestBundle/Resources/config/validation.xml', $xmlMappings[1]);
831831

@@ -849,10 +849,10 @@ public function testValidationPathsUsingCustomBundlePath()
849849

850850
try {
851851
// Testing symfony/symfony
852-
$this->assertStringEndsWith('Component'.DIRECTORY_SEPARATOR.'Form/Resources/config/validation.xml', $xmlMappings[0]);
852+
$this->assertStringEndsWith('Component'.\DIRECTORY_SEPARATOR.'Form/Resources/config/validation.xml', $xmlMappings[0]);
853853
} catch (\Exception $e) {
854854
// Testing symfony/framework-bundle with deps=high
855-
$this->assertStringEndsWith('symfony'.DIRECTORY_SEPARATOR.'form/Resources/config/validation.xml', $xmlMappings[0]);
855+
$this->assertStringEndsWith('symfony'.\DIRECTORY_SEPARATOR.'form/Resources/config/validation.xml', $xmlMappings[0]);
856856
}
857857
$this->assertStringEndsWith('CustomPathBundle/Resources/config/validation.xml', $xmlMappings[1]);
858858

@@ -1096,15 +1096,15 @@ public function testSerializerMapping()
10961096

10971097
foreach ($expectedLoaders as $definition) {
10981098
if (is_file($arg = $definition->getArgument(0))) {
1099-
$definition->replaceArgument(0, strtr($arg, '/', DIRECTORY_SEPARATOR));
1099+
$definition->replaceArgument(0, strtr($arg, '/', \DIRECTORY_SEPARATOR));
11001100
}
11011101
$definition->setPublic(false);
11021102
}
11031103

11041104
$loaders = $container->getDefinition('serializer.mapping.chain_loader')->getArgument(0);
11051105
foreach ($loaders as $loader) {
11061106
if (is_file($arg = $loader->getArgument(0))) {
1107-
$loader->replaceArgument(0, strtr($arg, '/', DIRECTORY_SEPARATOR));
1107+
$loader->replaceArgument(0, strtr($arg, '/', \DIRECTORY_SEPARATOR));
11081108
}
11091109
}
11101110
$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
@@ -368,7 +368,7 @@ public function openAction(Request $request)
368368
$file = $request->query->get('file');
369369
$line = $request->query->get('line');
370370

371-
$filename = $this->baseDir.DIRECTORY_SEPARATOR.$file;
371+
$filename = $this->baseDir.\DIRECTORY_SEPARATOR.$file;
372372

373373
if (preg_match("'(^|[/\\\\])\.'", $file) || !is_readable($filename)) {
374374
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);
@@ -81,7 +81,7 @@ protected function doHave($id)
8181
*/
8282
protected function doClear($namespace)
8383
{
84-
return isset($namespace[0]) && class_exists('APCuIterator', false) && ('cli' !== PHP_SAPI || ini_get('apc.enable_cli'))
84+
return isset($namespace[0]) && class_exists('APCuIterator', false) && ('cli' !== \PHP_SAPI || ini_get('apc.enable_cli'))
8585
? apcu_delete(new \APCuIterator(sprintf('/^%s/', preg_quote($namespace, '/')), APC_ITER_KEY))
8686
: apcu_clear_cache();
8787
}

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

@@ -105,7 +105,7 @@ private function getFile($id, $mkdir = false)
105105
{
106106
// Use MD5 to favor speed over security, which is not an issue here
107107
$hash = str_replace('/', '-', base64_encode(hash('md5', static::class.$id, true)));
108-
$dir = $this->directory.strtoupper($hash[0].DIRECTORY_SEPARATOR.$hash[1].DIRECTORY_SEPARATOR);
108+
$dir = $this->directory.strtoupper($hash[0].\DIRECTORY_SEPARATOR.$hash[1].\DIRECTORY_SEPARATOR);
109109

110110
if ($mkdir && !file_exists($dir)) {
111111
@mkdir($dir, 0777, true);

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);

src/Symfony/Component/Config/FileLocator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function locate($name, $currentPath = null, $first = true)
5757
$filepaths = $notfound = array();
5858

5959
foreach ($paths as $path) {
60-
if (@file_exists($file = $path.DIRECTORY_SEPARATOR.$name)) {
60+
if (@file_exists($file = $path.\DIRECTORY_SEPARATOR.$name)) {
6161
if (true === $first) {
6262
return $file;
6363
}

src/Symfony/Component/Config/Resource/ReflectionClassResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ private function loadFiles(\ReflectionClass $class)
8181
$file = $class->getFileName();
8282
if (false !== $file && file_exists($file)) {
8383
foreach ($this->excludedVendors as $vendor) {
84-
if (0 === strpos($file, $vendor) && false !== strpbrk(substr($file, \strlen($vendor), 1), '/'.DIRECTORY_SEPARATOR)) {
84+
if (0 === strpos($file, $vendor) && false !== strpbrk(substr($file, \strlen($vendor), 1), '/'.\DIRECTORY_SEPARATOR)) {
8585
$file = false;
8686
break;
8787
}

0 commit comments

Comments
 (0)
0