Skip to content

Commit ad3c3e8

Browse files
Merge branch '4.4' into 5.1
* 4.4: Enable "native_constant_invocation" CS rule Make AbstractPhpFileCacheWarmer public
2 parents 4534dbf + ac5de06 commit ad3c3e8

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

Command/DebugCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ private function displayGeneralJson(SymfonyStyle $io, ?string $filter)
262262
$data['warnings'] = $this->buildWarningMessages($wrongBundles);
263263
}
264264

265-
$data = json_encode($data, JSON_PRETTY_PRINT);
265+
$data = json_encode($data, \JSON_PRETTY_PRINT);
266266
$io->writeln($decorated ? OutputFormatter::escape($data) : $data);
267267
}
268268

@@ -392,7 +392,7 @@ private function findWrongBundleOverrides(): array
392392
$bundleNames = [];
393393

394394
if ($this->twigDefaultPath && $this->projectDir) {
395-
$folders = glob($this->twigDefaultPath.'/bundles/*', GLOB_ONLYDIR);
395+
$folders = glob($this->twigDefaultPath.'/bundles/*', \GLOB_ONLYDIR);
396396
$relativePath = ltrim(substr($this->twigDefaultPath.'/bundles/', \strlen($this->projectDir)), \DIRECTORY_SEPARATOR);
397397
$bundleNames = array_reduce($folders, function ($carry, $absolutePath) use ($relativePath) {
398398
if (0 === strpos($absolutePath, $this->projectDir)) {
@@ -532,7 +532,7 @@ private function findAlternatives(string $name, array $collection): array
532532

533533
$threshold = 1e3;
534534
$alternatives = array_filter($alternatives, function ($lev) use ($threshold) { return $lev < 2 * $threshold; });
535-
ksort($alternatives, SORT_NATURAL | SORT_FLAG_CASE);
535+
ksort($alternatives, \SORT_NATURAL | \SORT_FLAG_CASE);
536536

537537
return array_keys($alternatives);
538538
}
@@ -548,7 +548,7 @@ private function getRelativePath(string $path): string
548548

549549
private function isAbsolutePath(string $file): bool
550550
{
551-
return strspn($file, '/\\', 0, 1) || (\strlen($file) > 3 && ctype_alpha($file[0]) && ':' === $file[1] && strspn($file, '/\\', 2, 1)) || null !== parse_url($file, PHP_URL_SCHEME);
551+
return strspn($file, '/\\', 0, 1) || (\strlen($file) > 3 && ctype_alpha($file[0]) && ':' === $file[1] && strspn($file, '/\\', 2, 1)) || null !== parse_url($file, \PHP_URL_SCHEME);
552552
}
553553

554554
/**

Command/LintCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
101101

102102
if ($showDeprecations) {
103103
$prevErrorHandler = set_error_handler(static function ($level, $message, $file, $line) use (&$prevErrorHandler) {
104-
if (E_USER_DEPRECATED === $level) {
104+
if (\E_USER_DEPRECATED === $level) {
105105
$templateLine = 0;
106106
if (preg_match('/ at line (\d+)[ .]/', $message, $matches)) {
107107
$templateLine = $matches[1];
@@ -214,7 +214,7 @@ private function displayJson(OutputInterface $output, array $filesInfo)
214214
}
215215
});
216216

217-
$output->writeln(json_encode($filesInfo, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
217+
$output->writeln(json_encode($filesInfo, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
218218

219219
return min($errors, 1);
220220
}

Extension/CodeExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function formatArgs(array $args): string
9797
} elseif ('resource' === $item[0]) {
9898
$formattedValue = '<em>resource</em>';
9999
} else {
100-
$formattedValue = str_replace("\n", '', htmlspecialchars(var_export($item[1], true), ENT_COMPAT | ENT_SUBSTITUTE, $this->charset));
100+
$formattedValue = str_replace("\n", '', htmlspecialchars(var_export($item[1], true), \ENT_COMPAT | \ENT_SUBSTITUTE, $this->charset));
101101
}
102102

103103
$result[] = \is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue);
@@ -166,7 +166,7 @@ public function formatFile(string $file, int $line, string $text = null): string
166166
}
167167

168168
if (false !== $link = $this->getFileLink($file, $line)) {
169-
return sprintf('<a href="%s" title="Click to open this file" class="file_link">%s</a>', htmlspecialchars($link, ENT_COMPAT | ENT_SUBSTITUTE, $this->charset), $text);
169+
return sprintf('<a href="%s" title="Click to open this file" class="file_link">%s</a>', htmlspecialchars($link, \ENT_COMPAT | \ENT_SUBSTITUTE, $this->charset), $text);
170170
}
171171

172172
return $text;
@@ -222,7 +222,7 @@ public function formatLogMessage(string $message, array $context): string
222222
}
223223
}
224224

225-
return htmlspecialchars($message, ENT_COMPAT | ENT_SUBSTITUTE, $this->charset);
225+
return htmlspecialchars($message, \ENT_COMPAT | \ENT_SUBSTITUTE, $this->charset);
226226
}
227227

228228
protected static function fixCodeMarkup(string $line): string

Translation/TwigExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ protected function extractTemplate(string $template, MessageCatalogue $catalogue
8989
*/
9090
protected function canBeExtracted(string $file)
9191
{
92-
return $this->isFile($file) && 'twig' === pathinfo($file, PATHINFO_EXTENSION);
92+
return $this->isFile($file) && 'twig' === pathinfo($file, \PATHINFO_EXTENSION);
9393
}
9494

9595
/**

0 commit comments

Comments
 (0)