Skip to content

Commit 17902d1

Browse files
Merge branch '2.8' into 3.4
* 2.8: Enable native_constant_invocation CS fixer
2 parents a281fdb + 79d26eb commit 17902d1

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

Command/AssetsInstallCommand.php

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

177177
if ($method === $expectedMethod) {
178-
$rows[] = array(sprintf('<fg=green;options=bold>%s</>', '\\' === DIRECTORY_SEPARATOR ? 'OK' : "\xE2\x9C\x94" /* HEAVY CHECK MARK (U+2714) */), $message, $method);
178+
$rows[] = array(sprintf('<fg=green;options=bold>%s</>', '\\' === \DIRECTORY_SEPARATOR ? 'OK' : "\xE2\x9C\x94" /* HEAVY CHECK MARK (U+2714) */), $message, $method);
179179
} else {
180-
$rows[] = array(sprintf('<fg=yellow;options=bold>%s</>', '\\' === DIRECTORY_SEPARATOR ? 'WARNING' : '!'), $message, $method);
180+
$rows[] = array(sprintf('<fg=yellow;options=bold>%s</>', '\\' === \DIRECTORY_SEPARATOR ? 'WARNING' : '!'), $message, $method);
181181
}
182182
} catch (\Exception $e) {
183183
$exitCode = 1;
184-
$rows[] = array(sprintf('<fg=red;options=bold>%s</>', '\\' === DIRECTORY_SEPARATOR ? 'ERROR' : "\xE2\x9C\x98" /* HEAVY BALLOT X (U+2718) */), $message, $e->getMessage());
184+
$rows[] = array(sprintf('<fg=red;options=bold>%s</>', '\\' === \DIRECTORY_SEPARATOR ? 'ERROR' : "\xE2\x9C\x98" /* HEAVY BALLOT X (U+2718) */), $message, $e->getMessage());
185185
}
186186
}
187187
// remove the assets of the bundles that no longer exist

Command/CacheClearCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ protected function warmup($warmupDir, $realCacheDir, $enableOptionalWarmers = tr
253253
foreach (Finder::create()->files()->depth('<2')->name($tempContainerClass.'*')->in($warmupDir) as $file) {
254254
$content = str_replace($tempContainerClass, $realContainerClass, file_get_contents($file));
255255
file_put_contents($file, $content);
256-
rename($file, str_replace(DIRECTORY_SEPARATOR.$tempContainerClass, DIRECTORY_SEPARATOR.$realContainerClass, $file));
256+
rename($file, str_replace(\DIRECTORY_SEPARATOR.$tempContainerClass, \DIRECTORY_SEPARATOR.$realContainerClass, $file));
257257
}
258258
if (is_dir($tempContainerDir = $warmupDir.'/'.\get_class($tempKernel->getContainer()))) {
259259
foreach (Finder::create()->files()->in($tempContainerDir) as $file) {

Test/KernelTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ protected static function getPhpUnitXmlDir()
5252

5353
$dir = static::getPhpUnitCliConfigArgument();
5454
if (null === $dir &&
55-
(is_file(getcwd().DIRECTORY_SEPARATOR.'phpunit.xml') ||
56-
is_file(getcwd().DIRECTORY_SEPARATOR.'phpunit.xml.dist'))) {
55+
(is_file(getcwd().\DIRECTORY_SEPARATOR.'phpunit.xml') ||
56+
is_file(getcwd().\DIRECTORY_SEPARATOR.'phpunit.xml.dist'))) {
5757
$dir = getcwd();
5858
}
5959

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

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
}
@@ -86,7 +86,7 @@ public function testCacheIsFreshAfterCacheClearedWithWarmup()
8686
return;
8787
}
8888
$containerRef = new \ReflectionClass(require $containerFile);
89-
$containerFile = str_replace('tes_'.DIRECTORY_SEPARATOR, 'test'.DIRECTORY_SEPARATOR, $containerRef->getFileName());
89+
$containerFile = str_replace('tes_'.\DIRECTORY_SEPARATOR, 'test'.\DIRECTORY_SEPARATOR, $containerRef->getFileName());
9090
$this->assertRegExp(sprintf('/\'kernel.container_class\'\s*=>\s*\'%s\'/', $containerClass), file_get_contents($containerFile), 'kernel.container_class is properly set on the dumped container');
9191
}
9292
}

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)

Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -501,29 +501,29 @@ public function testTranslator()
501501
$files = array_map('realpath', $options['resource_files']['en']);
502502
$ref = new \ReflectionClass('Symfony\Component\Validator\Validation');
503503
$this->assertContains(
504-
strtr(\dirname($ref->getFileName()).'/Resources/translations/validators.en.xlf', '/', DIRECTORY_SEPARATOR),
504+
strtr(\dirname($ref->getFileName()).'/Resources/translations/validators.en.xlf', '/', \DIRECTORY_SEPARATOR),
505505
$files,
506506
'->registerTranslatorConfiguration() finds Validator translation resources'
507507
);
508508
$ref = new \ReflectionClass('Symfony\Component\Form\Form');
509509
$this->assertContains(
510-
strtr(\dirname($ref->getFileName()).'/Resources/translations/validators.en.xlf', '/', DIRECTORY_SEPARATOR),
510+
strtr(\dirname($ref->getFileName()).'/Resources/translations/validators.en.xlf', '/', \DIRECTORY_SEPARATOR),
511511
$files,
512512
'->registerTranslatorConfiguration() finds Form translation resources'
513513
);
514514
$ref = new \ReflectionClass('Symfony\Component\Security\Core\Security');
515515
$this->assertContains(
516-
strtr(\dirname($ref->getFileName()).'/Resources/translations/security.en.xlf', '/', DIRECTORY_SEPARATOR),
516+
strtr(\dirname($ref->getFileName()).'/Resources/translations/security.en.xlf', '/', \DIRECTORY_SEPARATOR),
517517
$files,
518518
'->registerTranslatorConfiguration() finds Security translation resources'
519519
);
520520
$this->assertContains(
521-
strtr(__DIR__.'/Fixtures/translations/test_paths.en.yml', '/', DIRECTORY_SEPARATOR),
521+
strtr(__DIR__.'/Fixtures/translations/test_paths.en.yml', '/', \DIRECTORY_SEPARATOR),
522522
$files,
523523
'->registerTranslatorConfiguration() finds translation resources in custom paths'
524524
);
525525
$this->assertContains(
526-
strtr(__DIR__.'/translations/test_default.en.xlf', '/', DIRECTORY_SEPARATOR),
526+
strtr(__DIR__.'/translations/test_default.en.xlf', '/', \DIRECTORY_SEPARATOR),
527527
$files,
528528
'->registerTranslatorConfiguration() finds translation resources in default path'
529529
);
@@ -572,7 +572,7 @@ public function testValidation()
572572
$ref = new \ReflectionClass('Symfony\Component\Form\Form');
573573
$xmlMappings = array(
574574
\dirname($ref->getFileName()).'/Resources/config/validation.xml',
575-
strtr($projectDir.'/config/validator/foo.xml', '/', DIRECTORY_SEPARATOR),
575+
strtr($projectDir.'/config/validator/foo.xml', '/', \DIRECTORY_SEPARATOR),
576576
);
577577

578578
$calls = $container->getDefinition('validator.builder')->getMethodCalls();
@@ -666,10 +666,10 @@ public function testValidationPaths()
666666
$this->assertCount(3, $xmlMappings);
667667
try {
668668
// Testing symfony/symfony
669-
$this->assertStringEndsWith('Component'.DIRECTORY_SEPARATOR.'Form/Resources/config/validation.xml', $xmlMappings[0]);
669+
$this->assertStringEndsWith('Component'.\DIRECTORY_SEPARATOR.'Form/Resources/config/validation.xml', $xmlMappings[0]);
670670
} catch (\Exception $e) {
671671
// Testing symfony/framework-bundle with deps=high
672-
$this->assertStringEndsWith('symfony'.DIRECTORY_SEPARATOR.'form/Resources/config/validation.xml', $xmlMappings[0]);
672+
$this->assertStringEndsWith('symfony'.\DIRECTORY_SEPARATOR.'form/Resources/config/validation.xml', $xmlMappings[0]);
673673
}
674674
$this->assertStringEndsWith('TestBundle/Resources/config/validation.xml', $xmlMappings[1]);
675675

@@ -693,10 +693,10 @@ public function testValidationPathsUsingCustomBundlePath()
693693

694694
try {
695695
// Testing symfony/symfony
696-
$this->assertStringEndsWith('Component'.DIRECTORY_SEPARATOR.'Form/Resources/config/validation.xml', $xmlMappings[0]);
696+
$this->assertStringEndsWith('Component'.\DIRECTORY_SEPARATOR.'Form/Resources/config/validation.xml', $xmlMappings[0]);
697697
} catch (\Exception $e) {
698698
// Testing symfony/framework-bundle with deps=high
699-
$this->assertStringEndsWith('symfony'.DIRECTORY_SEPARATOR.'form/Resources/config/validation.xml', $xmlMappings[0]);
699+
$this->assertStringEndsWith('symfony'.\DIRECTORY_SEPARATOR.'form/Resources/config/validation.xml', $xmlMappings[0]);
700700
}
701701
$this->assertStringEndsWith('CustomPathBundle/Resources/config/validation.xml', $xmlMappings[1]);
702702

@@ -921,15 +921,15 @@ public function testSerializerMapping()
921921

922922
foreach ($expectedLoaders as $definition) {
923923
if (is_file($arg = $definition->getArgument(0))) {
924-
$definition->replaceArgument(0, strtr($arg, '/', DIRECTORY_SEPARATOR));
924+
$definition->replaceArgument(0, strtr($arg, '/', \DIRECTORY_SEPARATOR));
925925
}
926926
$definition->setPublic(false);
927927
}
928928

929929
$loaders = $container->getDefinition('serializer.mapping.chain_loader')->getArgument(0);
930930
foreach ($loaders as $loader) {
931931
if (is_file($arg = $loader->getArgument(0))) {
932-
$loader->replaceArgument(0, strtr($arg, '/', DIRECTORY_SEPARATOR));
932+
$loader->replaceArgument(0, strtr($arg, '/', \DIRECTORY_SEPARATOR));
933933
}
934934
}
935935
$this->assertEquals($expectedLoaders, $loaders);

0 commit comments

Comments
 (0)