Skip to content

Commit 34692c8

Browse files
Merge branch '4.4' into 5.1
* 4.4: Enable "native_constant_invocation" CS rule Make AbstractPhpFileCacheWarmer public
2 parents 48d6890 + fc9fd3b commit 34692c8

14 files changed

+26
-26
lines changed

Compiler/DecoratorServicePass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(?string $innerId = '.inner')
3636
public function process(ContainerBuilder $container)
3737
{
3838
$definitions = new \SplPriorityQueue();
39-
$order = PHP_INT_MAX;
39+
$order = \PHP_INT_MAX;
4040

4141
foreach ($container->getDefinitions() as $id => $definition) {
4242
if (!$decorated = $definition->getDecoratedService()) {

Dumper/PhpDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2052,7 +2052,7 @@ private function isSingleUsePrivateNode(ServiceReferenceGraphNode $node): bool
20522052
*/
20532053
private function export($value)
20542054
{
2055-
if (null !== $this->targetDirRegex && \is_string($value) && preg_match($this->targetDirRegex, $value, $matches, PREG_OFFSET_CAPTURE)) {
2055+
if (null !== $this->targetDirRegex && \is_string($value) && preg_match($this->targetDirRegex, $value, $matches, \PREG_OFFSET_CAPTURE)) {
20562056
$suffix = $matches[0][1] + \strlen($matches[0][0]);
20572057
$matches[0][1] += \strlen($matches[1][0]);
20582058
$prefix = $matches[0][1] ? $this->doExport(substr($value, 0, $matches[0][1]), true).'.' : '';

Dumper/Preloader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ public static function append(string $file, array $list): void
2727

2828
foreach ($list as $item) {
2929
if (0 === strpos($item, $cacheDir)) {
30-
file_put_contents($file, sprintf("require_once __DIR__.%s;\n", var_export(substr($item, \strlen($cacheDir)), true)), FILE_APPEND);
30+
file_put_contents($file, sprintf("require_once __DIR__.%s;\n", var_export(substr($item, \strlen($cacheDir)), true)), \FILE_APPEND);
3131
continue;
3232
}
3333

3434
$classes[] = sprintf("\$classes[] = %s;\n", var_export($item, true));
3535
}
3636

37-
file_put_contents($file, sprintf("\n\$classes = [];\n%sPreloader::preload(\$classes);\n", implode('', $classes)), FILE_APPEND);
37+
file_put_contents($file, sprintf("\n\$classes = [];\n%sPreloader::preload(\$classes);\n", implode('', $classes)), \FILE_APPEND);
3838
}
3939

4040
public static function preload(array $classes): void

EnvVarProcessor.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,19 +192,19 @@ public function getEnv(string $prefix, string $name, \Closure $getEnv)
192192
}
193193

194194
if ('bool' === $prefix) {
195-
return (bool) (filter_var($env, FILTER_VALIDATE_BOOLEAN) ?: filter_var($env, FILTER_VALIDATE_INT) ?: filter_var($env, FILTER_VALIDATE_FLOAT));
195+
return (bool) (filter_var($env, \FILTER_VALIDATE_BOOLEAN) ?: filter_var($env, \FILTER_VALIDATE_INT) ?: filter_var($env, \FILTER_VALIDATE_FLOAT));
196196
}
197197

198198
if ('int' === $prefix) {
199-
if (false === $env = filter_var($env, FILTER_VALIDATE_INT) ?: filter_var($env, FILTER_VALIDATE_FLOAT)) {
199+
if (false === $env = filter_var($env, \FILTER_VALIDATE_INT) ?: filter_var($env, \FILTER_VALIDATE_FLOAT)) {
200200
throw new RuntimeException(sprintf('Non-numeric env var "%s" cannot be cast to int.', $name));
201201
}
202202

203203
return (int) $env;
204204
}
205205

206206
if ('float' === $prefix) {
207-
if (false === $env = filter_var($env, FILTER_VALIDATE_FLOAT)) {
207+
if (false === $env = filter_var($env, \FILTER_VALIDATE_FLOAT)) {
208208
throw new RuntimeException(sprintf('Non-numeric env var "%s" cannot be cast to float.', $name));
209209
}
210210

@@ -226,7 +226,7 @@ public function getEnv(string $prefix, string $name, \Closure $getEnv)
226226
if ('json' === $prefix) {
227227
$env = json_decode($env, true);
228228

229-
if (JSON_ERROR_NONE !== json_last_error()) {
229+
if (\JSON_ERROR_NONE !== json_last_error()) {
230230
throw new RuntimeException(sprintf('Invalid JSON in env var "%s": ', $name).json_last_error_msg());
231231
}
232232

@@ -262,7 +262,7 @@ public function getEnv(string $prefix, string $name, \Closure $getEnv)
262262
}
263263

264264
if ('query_string' === $prefix) {
265-
$queryString = parse_url($env, PHP_URL_QUERY) ?: $env;
265+
$queryString = parse_url($env, \PHP_URL_QUERY) ?: $env;
266266
parse_str($queryString, $result);
267267

268268
return $result;

Loader/IniFileLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function load($resource, string $type = null)
3737
}
3838

3939
// real raw parsing
40-
$result = parse_ini_file($path, true, INI_SCANNER_RAW);
40+
$result = parse_ini_file($path, true, \INI_SCANNER_RAW);
4141

4242
if (isset($result['parameters']) && \is_array($result['parameters'])) {
4343
foreach ($result['parameters'] as $key => $value) {
@@ -55,7 +55,7 @@ public function supports($resource, string $type = null)
5555
return false;
5656
}
5757

58-
if (null === $type && 'ini' === pathinfo($resource, PATHINFO_EXTENSION)) {
58+
if (null === $type && 'ini' === pathinfo($resource, \PATHINFO_EXTENSION)) {
5959
return true;
6060
}
6161

Loader/PhpFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function supports($resource, string $type = null)
6464
return false;
6565
}
6666

67-
if (null === $type && 'php' === pathinfo($resource, PATHINFO_EXTENSION)) {
67+
if (null === $type && 'php' === pathinfo($resource, \PATHINFO_EXTENSION)) {
6868
return true;
6969
}
7070

Loader/XmlFileLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function supports($resource, string $type = null)
8282
return false;
8383
}
8484

85-
if (null === $type && 'xml' === pathinfo($resource, PATHINFO_EXTENSION)) {
85+
if (null === $type && 'xml' === pathinfo($resource, \PATHINFO_EXTENSION)) {
8686
return true;
8787
}
8888

@@ -624,7 +624,7 @@ public function validateSchema(\DOMDocument $dom)
624624
EOF
625625
;
626626

627-
if (LIBXML_VERSION < 20900) {
627+
if (\LIBXML_VERSION < 20900) {
628628
$disableEntities = libxml_disable_entity_loader(false);
629629
$valid = @$dom->schemaValidateSource($source);
630630
libxml_disable_entity_loader($disableEntities);

Loader/YamlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public function supports($resource, string $type = null)
167167
return false;
168168
}
169169

170-
if (null === $type && \in_array(pathinfo($resource, PATHINFO_EXTENSION), ['yaml', 'yml'], true)) {
170+
if (null === $type && \in_array(pathinfo($resource, \PATHINFO_EXTENSION), ['yaml', 'yml'], true)) {
171171
return true;
172172
}
173173

ServiceLocator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ private function createNotFoundException(string $id): NotFoundExceptionInterface
8484
return new ServiceNotFoundException($id, end($this->loading) ?: null, null, [], $msg);
8585
}
8686

87-
$class = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS, 4);
87+
$class = debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT | \DEBUG_BACKTRACE_IGNORE_ARGS, 4);
8888
$class = isset($class[3]['object']) ? \get_class($class[3]['object']) : null;
8989
$externalId = $this->externalId ?: $class;
9090

Tests/EnvVarProcessorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public function validConsts()
196196
{
197197
return [
198198
['Symfony\Component\DependencyInjection\Tests\EnvVarProcessorTest::TEST_CONST', self::TEST_CONST],
199-
['E_ERROR', E_ERROR],
199+
['E_ERROR', \E_ERROR],
200200
];
201201
}
202202

0 commit comments

Comments
 (0)