Skip to content

Commit e264292

Browse files
Merge branch '2.8' into 3.4
* 2.8: Fix Clidumper tests Enable the fixer enforcing fully-qualified calls for compiler-optimized functions Apply fixers Disable the native_constant_invocation fixer until it can be scoped Update the list of excluded files for the CS fixer
2 parents c11bcf9 + 07bd17b commit e264292

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+173
-173
lines changed

Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ protected function getScript($request)
169169
foreach (get_declared_classes() as $class) {
170170
if (0 === strpos($class, 'ComposerAutoloaderInit')) {
171171
$r = new \ReflectionClass($class);
172-
$file = dirname(dirname($r->getFileName())).'/autoload.php';
172+
$file = \dirname(\dirname($r->getFileName())).'/autoload.php';
173173
if (file_exists($file)) {
174174
$requires .= "require_once '".str_replace("'", "\\'", $file)."';\n";
175175
}

Command/AboutCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
6969
new TableSeparator(),
7070
array('<info>Kernel</>'),
7171
new TableSeparator(),
72-
array('Type', get_class($kernel)),
72+
array('Type', \get_class($kernel)),
7373
array('Name', $kernel->getName()),
7474
array('Environment', $kernel->getEnvironment()),
7575
array('Debug', $kernel->isDebug() ? 'true' : 'false'),
@@ -84,9 +84,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
8484
array('Architecture', (PHP_INT_SIZE * 8).' bits'),
8585
array('Intl locale', class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a'),
8686
array('Timezone', date_default_timezone_get().' (<comment>'.(new \DateTime())->format(\DateTime::W3C).'</>)'),
87-
array('OPcache', extension_loaded('Zend OPcache') && ini_get('opcache.enable') ? 'true' : 'false'),
88-
array('APCu', extension_loaded('apcu') && ini_get('apc.enabled') ? 'true' : 'false'),
89-
array('Xdebug', extension_loaded('xdebug') ? 'true' : 'false'),
87+
array('OPcache', \extension_loaded('Zend OPcache') && ini_get('opcache.enable') ? 'true' : 'false'),
88+
array('APCu', \extension_loaded('apcu') && ini_get('apc.enabled') ? 'true' : 'false'),
89+
array('Xdebug', \extension_loaded('xdebug') ? 'true' : 'false'),
9090
);
9191

9292
if ($dotenv = self::getDotenvVars()) {

Command/AbstractConfigCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function validateConfiguration(ExtensionInterface $extension, $configurat
109109
}
110110

111111
if (!$configuration instanceof ConfigurationInterface) {
112-
throw new \LogicException(sprintf('Configuration class "%s" should implement ConfigurationInterface in order to be dumpable', get_class($configuration)));
112+
throw new \LogicException(sprintf('Configuration class "%s" should implement ConfigurationInterface in order to be dumpable', \get_class($configuration)));
113113
}
114114
}
115115

Command/AssetsInstallCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
113113
if (!is_dir($targetArg)) {
114114
// deprecated, logic to be removed in 4.0
115115
// this allows the commands to work out of the box with web/ and public/
116-
if (is_dir(dirname($targetArg).'/web')) {
117-
$targetArg = dirname($targetArg).'/web';
116+
if (is_dir(\dirname($targetArg).'/web')) {
117+
$targetArg = \dirname($targetArg).'/web';
118118
} else {
119119
throw new InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $input->getArgument('target')));
120120
}
@@ -263,8 +263,8 @@ private function absoluteSymlinkWithFallback($originDir, $targetDir)
263263
private function symlink($originDir, $targetDir, $relative = false)
264264
{
265265
if ($relative) {
266-
$this->filesystem->mkdir(dirname($targetDir));
267-
$originDir = $this->filesystem->makePathRelative($originDir, realpath(dirname($targetDir)));
266+
$this->filesystem->mkdir(\dirname($targetDir));
267+
$originDir = $this->filesystem->makePathRelative($originDir, realpath(\dirname($targetDir)));
268268
}
269269
$this->filesystem->symlink($originDir, $targetDir);
270270
if (!file_exists($targetDir)) {

Command/CacheClearCommand.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
115115
$this->getApplication()->setDispatcher(new EventDispatcher());
116116

117117
$containerDir = new \ReflectionObject($kernel->getContainer());
118-
$containerDir = basename(dirname($containerDir->getFileName()));
118+
$containerDir = basename(\dirname($containerDir->getFileName()));
119119

120120
// the warmup cache dir name must have the same length as the real one
121121
// to avoid the many problems in serialized resources files
@@ -147,7 +147,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
147147

148148
if ('/' === \DIRECTORY_SEPARATOR && $mounts = @file('/proc/mounts')) {
149149
foreach ($mounts as $mount) {
150-
$mount = array_slice(explode(' ', $mount), 1, -3);
150+
$mount = \array_slice(explode(' ', $mount), 1, -3);
151151
if (!\in_array(array_pop($mount), array('vboxsf', 'nfs'))) {
152152
continue;
153153
}
@@ -201,7 +201,7 @@ protected function warmup($warmupDir, $realCacheDir, $enableOptionalWarmers = tr
201201
$tempKernel = $realKernel;
202202
} else {
203203
$this->warning = 'Calling "cache:clear" with a kernel that does not implement "Symfony\Component\HttpKernel\RebootableInterface" is deprecated since Symfony 3.4 and will be unsupported in 4.0.';
204-
$realKernelClass = get_class($realKernel);
204+
$realKernelClass = \get_class($realKernel);
205205
$namespace = '';
206206
if (false !== $pos = strrpos($realKernelClass, '\\')) {
207207
$namespace = substr($realKernelClass, 0, $pos);
@@ -236,8 +236,8 @@ protected function warmup($warmupDir, $realCacheDir, $enableOptionalWarmers = tr
236236
}
237237

238238
// fix references to the Kernel in .meta files
239-
$safeTempKernel = str_replace('\\', '\\\\', get_class($tempKernel));
240-
$realKernelFQN = get_class($realKernel);
239+
$safeTempKernel = str_replace('\\', '\\\\', \get_class($tempKernel));
240+
$realKernelFQN = \get_class($realKernel);
241241

242242
foreach (Finder::create()->files()->depth('<3')->name('*.meta')->in($warmupDir) as $file) {
243243
file_put_contents($file, preg_replace(
@@ -255,7 +255,7 @@ protected function warmup($warmupDir, $realCacheDir, $enableOptionalWarmers = tr
255255
file_put_contents($file, $content);
256256
rename($file, str_replace(DIRECTORY_SEPARATOR.$tempContainerClass, DIRECTORY_SEPARATOR.$realContainerClass, $file));
257257
}
258-
if (is_dir($tempContainerDir = $warmupDir.'/'.get_class($tempKernel->getContainer()))) {
258+
if (is_dir($tempContainerDir = $warmupDir.'/'.\get_class($tempKernel->getContainer()))) {
259259
foreach (Finder::create()->files()->in($tempContainerDir) as $file) {
260260
$content = str_replace($tempContainerClass, $realContainerClass, file_get_contents($file));
261261
file_put_contents($file, $content);
@@ -285,7 +285,7 @@ protected function getTempKernel(KernelInterface $parent, $namespace, $parentCla
285285
$class = substr($parentClass, 0, -1).'_';
286286
// the temp container class must be changed too
287287
$container = $parent->getContainer();
288-
$realContainerClass = var_export($container->hasParameter('kernel.container_class') ? $container->getParameter('kernel.container_class') : get_class($parent->getContainer()), true);
288+
$realContainerClass = var_export($container->hasParameter('kernel.container_class') ? $container->getParameter('kernel.container_class') : \get_class($parent->getContainer()), true);
289289
$containerClass = substr_replace($realContainerClass, '_', -2, 1);
290290

291291
if (method_exists($parent, 'getProjectDir')) {

Command/ContainerDebugCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ protected function getContainerBuilder()
190190
$kernel = $this->getApplication()->getKernel();
191191

192192
if (!$kernel->isDebug() || !(new ConfigCache($kernel->getContainer()->getParameter('debug.container.dump'), true))->isFresh()) {
193-
$buildContainer = \Closure::bind(function () { return $this->buildContainer(); }, $kernel, get_class($kernel));
193+
$buildContainer = \Closure::bind(function () { return $this->buildContainer(); }, $kernel, \get_class($kernel));
194194
$container = $buildContainer();
195195
$container->getCompilerPassConfig()->setRemovingPasses(array());
196196
$container->compile();
@@ -212,7 +212,7 @@ private function findProperServiceName(InputInterface $input, SymfonyStyle $io,
212212
throw new InvalidArgumentException(sprintf('No services found that match "%s".', $name));
213213
}
214214

215-
$default = 1 === count($matchingServices) ? $matchingServices[0] : null;
215+
$default = 1 === \count($matchingServices) ? $matchingServices[0] : null;
216216

217217
return $io->choice('Select one of the following services to display its information', $matchingServices, $default);
218218
}

Command/RouterDebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private function extractCallable(Route $route)
165165
if (1 === substr_count($controller, ':')) {
166166
list($service, $method) = explode(':', $controller);
167167
try {
168-
return sprintf('%s::%s', get_class($this->getApplication()->getKernel()->getContainer()->get($service)), $method);
168+
return sprintf('%s::%s', \get_class($this->getApplication()->getKernel()->getContainer()->get($service)), $method);
169169
} catch (ServiceNotFoundException $e) {
170170
}
171171
}

Command/TranslationDebugCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
250250
$states[] = self::MESSAGE_UNUSED;
251251
}
252252

253-
if (!in_array(self::MESSAGE_UNUSED, $states) && true === $input->getOption('only-unused')
254-
|| !in_array(self::MESSAGE_MISSING, $states) && true === $input->getOption('only-missing')) {
253+
if (!\in_array(self::MESSAGE_UNUSED, $states) && true === $input->getOption('only-unused')
254+
|| !\in_array(self::MESSAGE_MISSING, $states) && true === $input->getOption('only-missing')) {
255255
continue;
256256
}
257257

@@ -315,7 +315,7 @@ private function sanitizeString($string, $length = 40)
315315
if (mb_strlen($string, $encoding) > $length) {
316316
return mb_substr($string, 0, $length - 3, $encoding).'...';
317317
}
318-
} elseif (strlen($string) > $length) {
318+
} elseif (\strlen($string) > $length) {
319319
return substr($string, 0, $length - 3).'...';
320320
}
321321

Command/TranslationUpdateCommand.php

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

153153
// check format
154154
$supportedFormats = $this->writer->getFormats();
155-
if (!in_array($input->getOption('output-format'), $supportedFormats)) {
155+
if (!\in_array($input->getOption('output-format'), $supportedFormats)) {
156156
$errorIo->error(array('Wrong output format', 'Supported formats are: '.implode(', ', $supportedFormats).'.'));
157157

158158
return 1;
@@ -237,7 +237,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
237237
: new MergeOperation($currentCatalogue, $extractedCatalogue);
238238

239239
// Exit if no messages found.
240-
if (!count($operation->getDomains())) {
240+
if (!\count($operation->getDomains())) {
241241
$errorIo->warning('No translation messages were found.');
242242

243243
return;
@@ -263,7 +263,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
263263
}, array_keys($operation->getObsoleteMessages($domain)))
264264
);
265265

266-
$domainMessagesCount = count($list);
266+
$domainMessagesCount = \count($list);
267267

268268
$io->section(sprintf('Messages extracted for domain "<info>%s</info>" (%d message%s)', $domain, $domainMessagesCount, $domainMessagesCount > 1 ? 's' : ''));
269269
$io->listing($list);

Command/XliffLintCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class XliffLintCommand extends BaseLintCommand
2828

2929
public function __construct($name = null, $directoryIteratorProvider = null, $isReadableProvider = null)
3030
{
31-
if (func_num_args()) {
31+
if (\func_num_args()) {
3232
@trigger_error(sprintf('Passing a constructor argument in "%s()" is deprecated since Symfony 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED);
3333
}
3434

0 commit comments

Comments
 (0)