Skip to content

Commit 1dd98ab

Browse files
Merge branch '4.4' into 5.1
* 4.4: Enable "native_constant_invocation" CS rule Make AbstractPhpFileCacheWarmer public
2 parents 0607ca3 + 1e1d4eb commit 1dd98ab

File tree

10 files changed

+15
-18
lines changed

10 files changed

+15
-18
lines changed

CacheWarmer/AbstractPhpFileCacheWarmer.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
use Symfony\Component\Config\Resource\ClassExistenceResource;
1818
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
1919

20-
/**
21-
* @internal
22-
*/
2320
abstract class AbstractPhpFileCacheWarmer implements CacheWarmerInterface
2421
{
2522
private $phpArrayFile;

Command/AboutCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8080
new TableSeparator(),
8181
['<info>PHP</>'],
8282
new TableSeparator(),
83-
['Version', PHP_VERSION],
83+
['Version', \PHP_VERSION],
8484
['Architecture', (\PHP_INT_SIZE * 8).' bits'],
8585
['Intl locale', class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a'],
8686
['Timezone', date_default_timezone_get().' (<comment>'.(new \DateTime())->format(\DateTime::W3C).'</>)'],
87-
['OPcache', \extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false'],
88-
['APCu', \extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false'],
87+
['OPcache', \extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false'],
88+
['APCu', \extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), \FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false'],
8989
['Xdebug', \extension_loaded('xdebug') ? 'true' : 'false'],
9090
];
9191

Command/AbstractConfigCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ protected function listBundles($output)
6363
protected function findExtension(string $name)
6464
{
6565
$bundles = $this->initializeBundles();
66-
$minScore = INF;
66+
$minScore = \INF;
6767

6868
$kernel = $this->getApplication()->getKernel();
6969
if ($kernel instanceof ExtensionInterface && ($kernel instanceof ConfigurationInterface || $kernel instanceof ConfigurationExtensionInterface)) {

Console/Descriptor/JsonDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ private function writeData(array $data, array $options)
183183
{
184184
$flags = isset($options['json_encoding']) ? $options['json_encoding'] : 0;
185185

186-
$this->write(json_encode($data, $flags | JSON_PRETTY_PRINT)."\n");
186+
$this->write(json_encode($data, $flags | \JSON_PRETTY_PRINT)."\n");
187187
}
188188

189189
protected function getRouteData(Route $route): array

Controller/RedirectController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function urlRedirectAction(Request $request, string $path, bool $permanen
119119
}
120120

121121
// redirect if the path is a full URL
122-
if (parse_url($path, PHP_URL_SCHEME)) {
122+
if (parse_url($path, \PHP_URL_SCHEME)) {
123123
return new RedirectResponse($path, $statusCode);
124124
}
125125

DependencyInjection/Compiler/ProfilerPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function process(ContainerBuilder $container)
3232
$definition = $container->getDefinition('profiler');
3333

3434
$collectors = new \SplPriorityQueue();
35-
$order = PHP_INT_MAX;
35+
$order = \PHP_INT_MAX;
3636
foreach ($container->findTaggedServiceIds('data_collector', true) as $id => $attributes) {
3737
$priority = isset($attributes[0]['priority']) ? $attributes[0]['priority'] : 0;
3838
$template = null;

DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ private function createVersion(ContainerBuilder $container, ?string $version, ?s
10601060

10611061
if (null !== $jsonManifestPath) {
10621062
$definitionName = 'assets.json_manifest_version_strategy';
1063-
if (0 === strpos(parse_url($jsonManifestPath, PHP_URL_SCHEME), 'http')) {
1063+
if (0 === strpos(parse_url($jsonManifestPath, \PHP_URL_SCHEME), 'http')) {
10641064
$definitionName = 'assets.remote_json_manifest_version_strategy';
10651065
}
10661066

Secrets/SodiumVault.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function seal(string $name, string $value): void
8989
$list = $this->list();
9090
$list[$name] = null;
9191
uksort($list, 'strnatcmp');
92-
file_put_contents($this->pathPrefix.'list.php', sprintf("<?php\n\nreturn %s;\n", var_export($list, true), LOCK_EX));
92+
file_put_contents($this->pathPrefix.'list.php', sprintf("<?php\n\nreturn %s;\n", var_export($list, true), \LOCK_EX));
9393

9494
$this->lastMessage = sprintf('Secret "%s" encrypted in "%s"; you can commit it.', $name, $this->getPrettyPath(\dirname($this->pathPrefix).\DIRECTORY_SEPARATOR));
9595
}
@@ -141,7 +141,7 @@ public function remove(string $name): bool
141141

142142
$list = $this->list();
143143
unset($list[$name]);
144-
file_put_contents($this->pathPrefix.'list.php', sprintf("<?php\n\nreturn %s;\n", var_export($list, true), LOCK_EX));
144+
file_put_contents($this->pathPrefix.'list.php', sprintf("<?php\n\nreturn %s;\n", var_export($list, true), \LOCK_EX));
145145

146146
$this->lastMessage = sprintf('Secret "%s" removed from "%s".', $name, $this->getPrettyPath(\dirname($this->pathPrefix).\DIRECTORY_SEPARATOR));
147147

@@ -205,9 +205,9 @@ private function export(string $file, string $data): void
205205

206206
$this->createSecretsDir();
207207

208-
if (false === file_put_contents($this->pathPrefix.$file.'.php', $data, LOCK_EX)) {
208+
if (false === file_put_contents($this->pathPrefix.$file.'.php', $data, \LOCK_EX)) {
209209
$e = error_get_last();
210-
throw new \ErrorException($e['message'] ?? 'Failed to write secrets data.', 0, $e['type'] ?? E_USER_WARNING);
210+
throw new \ErrorException($e['message'] ?? 'Failed to write secrets data.', 0, $e['type'] ?? \E_USER_WARNING);
211211
}
212212
}
213213

Tests/Console/Descriptor/AbstractDescriptorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,9 @@ private function assertDescription($expectedDescription, $describedObject, array
242242
$this->getDescriptor()->describe($output, $describedObject, $options);
243243

244244
if ('json' === $this->getFormat()) {
245-
$this->assertEquals(json_encode(json_decode($expectedDescription), JSON_PRETTY_PRINT), json_encode(json_decode($output->fetch()), JSON_PRETTY_PRINT));
245+
$this->assertEquals(json_encode(json_decode($expectedDescription), \JSON_PRETTY_PRINT), json_encode(json_decode($output->fetch()), \JSON_PRETTY_PRINT));
246246
} else {
247-
$this->assertEquals(trim($expectedDescription), trim(str_replace(PHP_EOL, "\n", $output->fetch())));
247+
$this->assertEquals(trim($expectedDescription), trim(str_replace(\PHP_EOL, "\n", $output->fetch())));
248248
}
249249
}
250250

Tests/Controller/AbstractControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public function testJsonWithSerializerContextOverride()
224224
$response = $controller->json([], 200, [], ['json_encode_options' => 0, 'other' => 'context']);
225225
$this->assertInstanceOf(JsonResponse::class, $response);
226226
$this->assertEquals('[]', $response->getContent());
227-
$response->setEncodingOptions(JSON_FORCE_OBJECT);
227+
$response->setEncodingOptions(\JSON_FORCE_OBJECT);
228228
$this->assertEquals('{}', $response->getContent());
229229
}
230230

0 commit comments

Comments
 (0)