Skip to content

Commit 0aeb6c1

Browse files
Merge branch '4.0' into 4.1
* 4.0: 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 a5779f0 + b0ec679 commit 0aeb6c1

Some content is hidden

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

45 files changed

+157
-158
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
@@ -228,8 +228,8 @@ private function absoluteSymlinkWithFallback(string $originDir, string $targetDi
228228
private function symlink(string $originDir, string $targetDir, bool $relative = false)
229229
{
230230
if ($relative) {
231-
$this->filesystem->mkdir(dirname($targetDir));
232-
$originDir = $this->filesystem->makePathRelative($originDir, realpath(dirname($targetDir)));
231+
$this->filesystem->mkdir(\dirname($targetDir));
232+
$originDir = $this->filesystem->makePathRelative($originDir, realpath(\dirname($targetDir)));
233233
}
234234
$this->filesystem->symlink($originDir, $targetDir);
235235
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
$containerFile = (new \ReflectionObject($kernel->getContainer()))->getFileName();
98-
$containerDir = basename(dirname($containerFile));
98+
$containerDir = basename(\dirname($containerFile));
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
@@ -136,7 +136,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
136136

137137
if ('/' === \DIRECTORY_SEPARATOR && $mounts = @file('/proc/mounts')) {
138138
foreach ($mounts as $mount) {
139-
$mount = array_slice(explode(' ', $mount), 1, -3);
139+
$mount = \array_slice(explode(' ', $mount), 1, -3);
140140
if (!\in_array(array_pop($mount), array('vboxsf', 'nfs'))) {
141141
continue;
142142
}

Command/ContainerDebugCommand.php

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

199199
if (!$kernel->isDebug() || !(new ConfigCache($kernel->getContainer()->getParameter('debug.container.dump'), true))->isFresh()) {
200-
$buildContainer = \Closure::bind(function () { return $this->buildContainer(); }, $kernel, get_class($kernel));
200+
$buildContainer = \Closure::bind(function () { return $this->buildContainer(); }, $kernel, \get_class($kernel));
201201
$container = $buildContainer();
202202
$container->getCompilerPassConfig()->setRemovingPasses(array());
203203
$container->compile();
@@ -219,7 +219,7 @@ private function findProperServiceName(InputInterface $input, SymfonyStyle $io,
219219
throw new InvalidArgumentException(sprintf('No services found that match "%s".', $name));
220220
}
221221

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

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

Command/RouterDebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7979

8080
if ($name) {
8181
if (!($route = $routes->get($name)) && $matchingRoutes = $this->findRouteNameContaining($name, $routes)) {
82-
$default = 1 === count($matchingRoutes) ? $matchingRoutes[0] : null;
82+
$default = 1 === \count($matchingRoutes) ? $matchingRoutes[0] : null;
8383
$name = $io->choice('Select one of the matching routes', $matchingRoutes, $default);
8484
$route = $routes->get($name);
8585
}

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
@@ -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

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

188-
if (is_string($value)) {
188+
if (\is_string($value)) {
189189
return $value;
190190
}
191191

@@ -201,7 +201,7 @@ protected function formatValue($value)
201201
*/
202202
protected function formatParameter($value)
203203
{
204-
if (is_bool($value) || is_array($value) || (null === $value)) {
204+
if (\is_bool($value) || \is_array($value) || (null === $value)) {
205205
$jsonString = json_encode($value);
206206

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

0 commit comments

Comments
 (0)