Skip to content

Commit 604f357

Browse files
Merge branch '4.1'
* 4.1: Enable native_constant_invocation CS fixer
2 parents 3ce8103 + 0fdf6b2 commit 604f357

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

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

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

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

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 {

0 commit comments

Comments
 (0)