Skip to content

Commit 2e43220

Browse files
Merge branch '4.0' into 4.1
* 4.0: Enable native_constant_invocation CS fixer
2 parents 92f6742 + 13d2e06 commit 2e43220

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

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

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
}
@@ -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
}

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
@@ -657,29 +657,29 @@ public function testTranslator()
657657
$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);

0 commit comments

Comments
 (0)