Skip to content

Commit 07bd17b

Browse files
committed
Enable the fixer enforcing fully-qualified calls for compiler-optimized functions
1 parent e78ba64 commit 07bd17b

Some content is hidden

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

51 files changed

+158
-158
lines changed

Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ protected function getScript($request)
166166

167167
$r = new \ReflectionObject($this->kernel);
168168

169-
$autoloader = dirname($r->getFileName()).'/autoload.php';
169+
$autoloader = \dirname($r->getFileName()).'/autoload.php';
170170
if (is_file($autoloader)) {
171171
$autoloader = str_replace("'", "\\'", $autoloader);
172172
} else {

Command/AbstractConfigCommand.php

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

8585
if (!$configuration instanceof ConfigurationInterface) {
86-
throw new \LogicException(sprintf('Configuration class "%s" should implement ConfigurationInterface in order to be dumpable', get_class($configuration)));
86+
throw new \LogicException(sprintf('Configuration class "%s" should implement ConfigurationInterface in order to be dumpable', \get_class($configuration)));
8787
}
8888
}
8989

Command/AssetsInstallCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ private function absoluteSymlinkWithFallback($originDir, $targetDir)
227227
private function symlink($originDir, $targetDir, $relative = false)
228228
{
229229
if ($relative) {
230-
$originDir = $this->filesystem->makePathRelative($originDir, realpath(dirname($targetDir)));
230+
$originDir = $this->filesystem->makePathRelative($originDir, realpath(\dirname($targetDir)));
231231
}
232232
$this->filesystem->symlink($originDir, $targetDir);
233233
if (!file_exists($targetDir)) {

Command/CacheClearCommand.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ protected function warmup($warmupDir, $realCacheDir, $enableOptionalWarmers = tr
124124
{
125125
// create a temporary kernel
126126
$realKernel = $this->getContainer()->get('kernel');
127-
$realKernelClass = get_class($realKernel);
127+
$realKernelClass = \get_class($realKernel);
128128
$namespace = '';
129129
if (false !== $pos = strrpos($realKernelClass, '\\')) {
130130
$namespace = substr($realKernelClass, 0, $pos);
@@ -144,8 +144,8 @@ protected function warmup($warmupDir, $realCacheDir, $enableOptionalWarmers = tr
144144
$warmer->warmUp($warmupDir);
145145

146146
// fix references to the Kernel in .meta files
147-
$safeTempKernel = str_replace('\\', '\\\\', get_class($tempKernel));
148-
$realKernelFQN = get_class($realKernel);
147+
$safeTempKernel = str_replace('\\', '\\\\', \get_class($tempKernel));
148+
$realKernelFQN = \get_class($realKernel);
149149

150150
foreach (Finder::create()->files()->depth('<3')->name('*.meta')->in($warmupDir) as $file) {
151151
file_put_contents($file, preg_replace(
@@ -166,8 +166,8 @@ protected function warmup($warmupDir, $realCacheDir, $enableOptionalWarmers = tr
166166
}
167167

168168
// fix references to container's class
169-
$tempContainerClass = get_class($tempKernel->getContainer());
170-
$realContainerClass = get_class($realKernel->getContainer());
169+
$tempContainerClass = \get_class($tempKernel->getContainer());
170+
$realContainerClass = \get_class($realKernel->getContainer());
171171
foreach (Finder::create()->files()->depth('<2')->name($tempContainerClass.'*')->in($warmupDir) as $file) {
172172
$content = str_replace($tempContainerClass, $realContainerClass, file_get_contents($file));
173173
file_put_contents($file, $content);
@@ -195,7 +195,7 @@ protected function getTempKernel(KernelInterface $parent, $namespace, $parentCla
195195
// to avoid the many problems in serialized resources files
196196
$class = substr($parentClass, 0, -1).'_';
197197
// the temp container class must be changed too
198-
$containerClass = var_export(substr(get_class($parent->getContainer()), 0, -1).'_', true);
198+
$containerClass = var_export(substr(\get_class($parent->getContainer()), 0, -1).'_', true);
199199
$code = <<<EOF
200200
<?php
201201

Command/ServerCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ abstract class ServerCommand extends ContainerAwareCommand
2323
*/
2424
public function isEnabled()
2525
{
26-
if (\PHP_VERSION_ID < 50400 || defined('HHVM_VERSION')) {
26+
if (\PHP_VERSION_ID < 50400 || \defined('HHVM_VERSION')) {
2727
return false;
2828
}
2929

Command/ServerStartCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7676
{
7777
$io = new SymfonyStyle($input, $cliOutput = $output);
7878

79-
if (!extension_loaded('pcntl')) {
79+
if (!\extension_loaded('pcntl')) {
8080
$io->error(array(
8181
'This command needs the pcntl extension to run.',
8282
'You can either install it or use the "server:run" command instead to run the built-in web server.',

Command/TranslationDebugCommand.php

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

184-
if (!in_array(self::MESSAGE_UNUSED, $states) && true === $input->getOption('only-unused')
185-
|| !in_array(self::MESSAGE_MISSING, $states) && true === $input->getOption('only-missing')) {
184+
if (!\in_array(self::MESSAGE_UNUSED, $states) && true === $input->getOption('only-unused')
185+
|| !\in_array(self::MESSAGE_MISSING, $states) && true === $input->getOption('only-missing')) {
186186
continue;
187187
}
188188

@@ -246,7 +246,7 @@ private function sanitizeString($string, $length = 40)
246246
if (mb_strlen($string, $encoding) > $length) {
247247
return mb_substr($string, 0, $length - 3, $encoding).'...';
248248
}
249-
} elseif (strlen($string) > $length) {
249+
} elseif (\strlen($string) > $length) {
250250
return substr($string, 0, $length - 3).'...';
251251
}
252252

Command/TranslationUpdateCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8282
// check format
8383
$writer = $this->getContainer()->get('translation.writer');
8484
$supportedFormats = $writer->getFormats();
85-
if (!in_array($input->getOption('output-format'), $supportedFormats)) {
85+
if (!\in_array($input->getOption('output-format'), $supportedFormats)) {
8686
$io->error(array('Wrong output format', 'Supported formats are: '.implode(', ', $supportedFormats).'.'));
8787

8888
return 1;
@@ -145,7 +145,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
145145
: new MergeOperation($currentCatalogue, $extractedCatalogue);
146146

147147
// Exit if no messages found.
148-
if (!count($operation->getDomains())) {
148+
if (!\count($operation->getDomains())) {
149149
$io->warning('No translation messages were found.');
150150

151151
return;
@@ -171,7 +171,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
171171
}, array_keys($operation->getObsoleteMessages($domain)))
172172
);
173173

174-
$domainMessagesCount = count($list);
174+
$domainMessagesCount = \count($list);
175175

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

Command/YamlLintCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ private function displayTxt(OutputInterface $output, SymfonyStyle $io, $filesInf
143143
}
144144

145145
if (0 === $errors) {
146-
$io->success(sprintf('All %d YAML files contain valid syntax.', count($filesInfo)));
146+
$io->success(sprintf('All %d YAML files contain valid syntax.', \count($filesInfo)));
147147
} else {
148-
$io->warning(sprintf('%d YAML files have valid syntax and %d contain errors.', count($filesInfo) - $errors, $errors));
148+
$io->warning(sprintf('%d YAML files have valid syntax and %d contain errors.', \count($filesInfo) - $errors, $errors));
149149
}
150150

151151
return min($errors, 1);
@@ -162,7 +162,7 @@ private function displayJson(OutputInterface $output, $filesInfo)
162162
}
163163
});
164164

165-
$output->writeln(json_encode($filesInfo, defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES : 0));
165+
$output->writeln(json_encode($filesInfo, \defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES : 0));
166166

167167
return min($errors, 1);
168168
}

Console/Descriptor/Descriptor.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ public function describe(OutputInterface $output, $object, array $options = arra
7272
case $object instanceof EventDispatcherInterface:
7373
$this->describeEventDispatcherListeners($object, $options);
7474
break;
75-
case is_callable($object):
75+
case \is_callable($object):
7676
$this->describeCallable($object, $options);
7777
break;
7878
default:
79-
throw new \InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_class($object)));
79+
throw new \InvalidArgumentException(sprintf('Object of type "%s" is not describable.', \get_class($object)));
8080
}
8181
}
8282

@@ -198,11 +198,11 @@ abstract protected function describeCallable($callable, array $options = array()
198198
*/
199199
protected function formatValue($value)
200200
{
201-
if (is_object($value)) {
202-
return sprintf('object(%s)', get_class($value));
201+
if (\is_object($value)) {
202+
return sprintf('object(%s)', \get_class($value));
203203
}
204204

205-
if (is_string($value)) {
205+
if (\is_string($value)) {
206206
return $value;
207207
}
208208

@@ -218,7 +218,7 @@ protected function formatValue($value)
218218
*/
219219
protected function formatParameter($value)
220220
{
221-
if (is_bool($value) || is_array($value) || (null === $value)) {
221+
if (\is_bool($value) || \is_array($value) || (null === $value)) {
222222
$jsonString = json_encode($value);
223223

224224
if (preg_match('/^(.{60})./us', $jsonString, $matches)) {

0 commit comments

Comments
 (0)