Skip to content

Commit b0ec679

Browse files
Merge branch '3.4' into 4.0
* 3.4: 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 aec316c + e264292 commit b0ec679

Some content is hidden

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

44 files changed

+151
-151
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
@@ -70,7 +70,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7070
new TableSeparator(),
7171
array('<info>Kernel</>'),
7272
new TableSeparator(),
73-
array('Type', get_class($kernel)),
73+
array('Type', \get_class($kernel)),
7474
array('Name', $kernel->getName()),
7575
array('Environment', $kernel->getEnvironment()),
7676
array('Debug', $kernel->isDebug() ? 'true' : 'false'),
@@ -85,9 +85,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
8585
array('Architecture', (PHP_INT_SIZE * 8).' bits'),
8686
array('Intl locale', class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a'),
8787
array('Timezone', date_default_timezone_get().' (<comment>'.(new \DateTime())->format(\DateTime::W3C).'</>)'),
88-
array('OPcache', extension_loaded('Zend OPcache') && ini_get('opcache.enable') ? 'true' : 'false'),
89-
array('APCu', extension_loaded('apcu') && ini_get('apc.enabled') ? 'true' : 'false'),
90-
array('Xdebug', extension_loaded('xdebug') ? 'true' : 'false'),
88+
array('OPcache', \extension_loaded('Zend OPcache') && ini_get('opcache.enable') ? 'true' : 'false'),
89+
array('APCu', \extension_loaded('apcu') && ini_get('apc.enabled') ? 'true' : 'false'),
90+
array('Xdebug', \extension_loaded('xdebug') ? 'true' : 'false'),
9191
);
9292

9393
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ private function absoluteSymlinkWithFallback(string $originDir, string $targetDi
227227
private function symlink(string $originDir, string $targetDir, bool $relative = false)
228228
{
229229
if ($relative) {
230-
$this->filesystem->mkdir(dirname($targetDir));
231-
$originDir = $this->filesystem->makePathRelative($originDir, realpath(dirname($targetDir)));
230+
$this->filesystem->mkdir(\dirname($targetDir));
231+
$originDir = $this->filesystem->makePathRelative($originDir, realpath(\dirname($targetDir)));
232232
}
233233
$this->filesystem->symlink($originDir, $targetDir);
234234
if (!file_exists($targetDir)) {

Command/CacheClearCommand.php

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

9797
$containerDir = new \ReflectionObject($kernel->getContainer());
98-
$containerDir = basename(dirname($containerDir->getFileName()));
98+
$containerDir = basename(\dirname($containerDir->getFileName()));
9999

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

122122
if ('/' === \DIRECTORY_SEPARATOR && $mounts = @file('/proc/mounts')) {
123123
foreach ($mounts as $mount) {
124-
$mount = array_slice(explode(' ', $mount), 1, -3);
124+
$mount = \array_slice(explode(' ', $mount), 1, -3);
125125
if (!\in_array(array_pop($mount), array('vboxsf', 'nfs'))) {
126126
continue;
127127
}

Command/ContainerDebugCommand.php

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

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

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

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

Command/RouterDebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ private function extractCallable(Route $route)
129129
if (1 === substr_count($controller, ':')) {
130130
list($service, $method) = explode(':', $controller);
131131
try {
132-
return sprintf('%s::%s', get_class($this->getApplication()->getKernel()->getContainer()->get($service)), $method);
132+
return sprintf('%s::%s', \get_class($this->getApplication()->getKernel()->getContainer()->get($service)), $method);
133133
} catch (ServiceNotFoundException $e) {
134134
}
135135
}

Command/TranslationDebugCommand.php

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

222-
if (!in_array(self::MESSAGE_UNUSED, $states) && true === $input->getOption('only-unused')
223-
|| !in_array(self::MESSAGE_MISSING, $states) && true === $input->getOption('only-missing')) {
222+
if (!\in_array(self::MESSAGE_UNUSED, $states) && true === $input->getOption('only-unused')
223+
|| !\in_array(self::MESSAGE_MISSING, $states) && true === $input->getOption('only-missing')) {
224224
continue;
225225
}
226226

@@ -284,7 +284,7 @@ private function sanitizeString(string $string, int $length = 40): string
284284
if (mb_strlen($string, $encoding) > $length) {
285285
return mb_substr($string, 0, $length - 3, $encoding).'...';
286286
}
287-
} elseif (strlen($string) > $length) {
287+
} elseif (\strlen($string) > $length) {
288288
return substr($string, 0, $length - 3).'...';
289289
}
290290

Command/TranslationUpdateCommand.php

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

112112
// check format
113113
$supportedFormats = $this->writer->getFormats();
114-
if (!in_array($input->getOption('output-format'), $supportedFormats)) {
114+
if (!\in_array($input->getOption('output-format'), $supportedFormats)) {
115115
$errorIo->error(array('Wrong output format', 'Supported formats are: '.implode(', ', $supportedFormats).'.'));
116116

117117
return 1;
@@ -190,7 +190,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
190190
: new MergeOperation($currentCatalogue, $extractedCatalogue);
191191

192192
// Exit if no messages found.
193-
if (!count($operation->getDomains())) {
193+
if (!\count($operation->getDomains())) {
194194
$errorIo->warning('No translation messages were found.');
195195

196196
return;
@@ -216,7 +216,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
216216
}, array_keys($operation->getObsoleteMessages($domain)))
217217
);
218218

219-
$domainMessagesCount = count($list);
219+
$domainMessagesCount = \count($list);
220220

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

Console/Descriptor/Descriptor.php

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

@@ -180,11 +180,11 @@ abstract protected function describeCallable($callable, array $options = array()
180180
*/
181181
protected function formatValue($value)
182182
{
183-
if (is_object($value)) {
184-
return sprintf('object(%s)', get_class($value));
183+
if (\is_object($value)) {
184+
return sprintf('object(%s)', \get_class($value));
185185
}
186186

187-
if (is_string($value)) {
187+
if (\is_string($value)) {
188188
return $value;
189189
}
190190

@@ -200,7 +200,7 @@ protected function formatValue($value)
200200
*/
201201
protected function formatParameter($value)
202202
{
203-
if (is_bool($value) || is_array($value) || (null === $value)) {
203+
if (\is_bool($value) || \is_array($value) || (null === $value)) {
204204
$jsonString = json_encode($value);
205205

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

0 commit comments

Comments
 (0)