Skip to content

Commit 4044c64

Browse files
Merge branch '3.4' into 4.4
* 3.4: Enable "native_constant_invocation" CS rule Make AbstractPhpFileCacheWarmer public
2 parents b39fd99 + c36a64a commit 4044c64

32 files changed

+116
-116
lines changed

Application.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ public function find($name)
719719
$command = $this->get(reset($commands));
720720

721721
if ($command->isHidden()) {
722-
@trigger_error(sprintf('Command "%s" is hidden, finding it using an abbreviation is deprecated since Symfony 4.4, use its full name instead.', $command->getName()), E_USER_DEPRECATED);
722+
@trigger_error(sprintf('Command "%s" is hidden, finding it using an abbreviation is deprecated since Symfony 4.4, use its full name instead.', $command->getName()), \E_USER_DEPRECATED);
723723
}
724724

725725
return $command;
@@ -798,7 +798,7 @@ public static function getAbbreviations($names)
798798
*/
799799
public function renderException(\Exception $e, OutputInterface $output)
800800
{
801-
@trigger_error(sprintf('The "%s::renderException()" method is deprecated since Symfony 4.4, use "renderThrowable()" instead.', __CLASS__), E_USER_DEPRECATED);
801+
@trigger_error(sprintf('The "%s::renderException()" method is deprecated since Symfony 4.4, use "renderThrowable()" instead.', __CLASS__), \E_USER_DEPRECATED);
802802

803803
$output->writeln('', OutputInterface::VERBOSITY_QUIET);
804804

@@ -810,10 +810,10 @@ public function renderException(\Exception $e, OutputInterface $output)
810810
public function renderThrowable(\Throwable $e, OutputInterface $output): void
811811
{
812812
if (__CLASS__ !== static::class && __CLASS__ === (new \ReflectionMethod($this, 'renderThrowable'))->getDeclaringClass()->getName() && __CLASS__ !== (new \ReflectionMethod($this, 'renderException'))->getDeclaringClass()->getName()) {
813-
@trigger_error(sprintf('The "%s::renderException()" method is deprecated since Symfony 4.4, use "renderThrowable()" instead.', __CLASS__), E_USER_DEPRECATED);
813+
@trigger_error(sprintf('The "%s::renderException()" method is deprecated since Symfony 4.4, use "renderThrowable()" instead.', __CLASS__), \E_USER_DEPRECATED);
814814

815815
if (!$e instanceof \Exception) {
816-
$e = class_exists(FatalThrowableError::class) ? new FatalThrowableError($e) : new \ErrorException($e->getMessage(), $e->getCode(), E_ERROR, $e->getFile(), $e->getLine());
816+
$e = class_exists(FatalThrowableError::class) ? new FatalThrowableError($e) : new \ErrorException($e->getMessage(), $e->getCode(), \E_ERROR, $e->getFile(), $e->getLine());
817817
}
818818

819819
$this->renderException($e, $output);
@@ -841,18 +841,18 @@ private function finishRenderThrowableOrException(OutputInterface $output): void
841841
*/
842842
protected function doRenderException(\Exception $e, OutputInterface $output)
843843
{
844-
@trigger_error(sprintf('The "%s::doRenderException()" method is deprecated since Symfony 4.4, use "doRenderThrowable()" instead.', __CLASS__), E_USER_DEPRECATED);
844+
@trigger_error(sprintf('The "%s::doRenderException()" method is deprecated since Symfony 4.4, use "doRenderThrowable()" instead.', __CLASS__), \E_USER_DEPRECATED);
845845

846846
$this->doActuallyRenderThrowable($e, $output);
847847
}
848848

849849
protected function doRenderThrowable(\Throwable $e, OutputInterface $output): void
850850
{
851851
if (__CLASS__ !== static::class && __CLASS__ === (new \ReflectionMethod($this, 'doRenderThrowable'))->getDeclaringClass()->getName() && __CLASS__ !== (new \ReflectionMethod($this, 'doRenderException'))->getDeclaringClass()->getName()) {
852-
@trigger_error(sprintf('The "%s::doRenderException()" method is deprecated since Symfony 4.4, use "doRenderThrowable()" instead.', __CLASS__), E_USER_DEPRECATED);
852+
@trigger_error(sprintf('The "%s::doRenderException()" method is deprecated since Symfony 4.4, use "doRenderThrowable()" instead.', __CLASS__), \E_USER_DEPRECATED);
853853

854854
if (!$e instanceof \Exception) {
855-
$e = class_exists(FatalThrowableError::class) ? new FatalThrowableError($e) : new \ErrorException($e->getMessage(), $e->getCode(), E_ERROR, $e->getFile(), $e->getLine());
855+
$e = class_exists(FatalThrowableError::class) ? new FatalThrowableError($e) : new \ErrorException($e->getMessage(), $e->getCode(), \E_ERROR, $e->getFile(), $e->getLine());
856856
}
857857

858858
$this->doRenderException($e, $output);
@@ -881,7 +881,7 @@ private function doActuallyRenderThrowable(\Throwable $e, OutputInterface $outpu
881881
}, $message);
882882
}
883883

884-
$width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : PHP_INT_MAX;
884+
$width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : \PHP_INT_MAX;
885885
$lines = [];
886886
foreach ('' !== $message ? preg_split('/\r?\n/', $message) : [] as $line) {
887887
foreach ($this->splitStringByWidth($line, $width - 4) as $line) {
@@ -1167,7 +1167,7 @@ private function findAlternatives(string $name, iterable $collection): array
11671167
}
11681168

11691169
$alternatives = array_filter($alternatives, function ($lev) use ($threshold) { return $lev < 2 * $threshold; });
1170-
ksort($alternatives, SORT_NATURAL | SORT_FLAG_CASE);
1170+
ksort($alternatives, \SORT_NATURAL | \SORT_FLAG_CASE);
11711171

11721172
return array_keys($alternatives);
11731173
}

Command/Command.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public function run(InputInterface $input, OutputInterface $output)
223223
if (null !== $this->processTitle) {
224224
if (\function_exists('cli_set_process_title')) {
225225
if (!@cli_set_process_title($this->processTitle)) {
226-
if ('Darwin' === PHP_OS) {
226+
if ('Darwin' === \PHP_OS) {
227227
$output->writeln('<comment>Running "cli_set_process_title" as an unprivileged user is not supported on MacOS.</comment>', OutputInterface::VERBOSITY_VERY_VERBOSE);
228228
} else {
229229
cli_set_process_title($this->processTitle);
@@ -255,7 +255,7 @@ public function run(InputInterface $input, OutputInterface $output)
255255
$statusCode = $this->execute($input, $output);
256256

257257
if (!\is_int($statusCode)) {
258-
@trigger_error(sprintf('Return value of "%s::execute()" should always be of the type int since Symfony 4.4, %s returned.', static::class, \gettype($statusCode)), E_USER_DEPRECATED);
258+
@trigger_error(sprintf('Return value of "%s::execute()" should always be of the type int since Symfony 4.4, %s returned.', static::class, \gettype($statusCode)), \E_USER_DEPRECATED);
259259
}
260260
}
261261

Descriptor/JsonDescriptor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ private function getInputArgumentData(InputArgument $argument): array
107107
'is_required' => $argument->isRequired(),
108108
'is_array' => $argument->isArray(),
109109
'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $argument->getDescription()),
110-
'default' => INF === $argument->getDefault() ? 'INF' : $argument->getDefault(),
110+
'default' => \INF === $argument->getDefault() ? 'INF' : $argument->getDefault(),
111111
];
112112
}
113113

@@ -120,7 +120,7 @@ private function getInputOptionData(InputOption $option): array
120120
'is_value_required' => $option->isValueRequired(),
121121
'is_multiple' => $option->isArray(),
122122
'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $option->getDescription()),
123-
'default' => INF === $option->getDefault() ? 'INF' : $option->getDefault(),
123+
'default' => \INF === $option->getDefault() ? 'INF' : $option->getDefault(),
124124
];
125125
}
126126

Descriptor/TextDescriptor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ private function getCommandAliasesText(Command $command): string
280280
*/
281281
private function formatDefaultValue($default): string
282282
{
283-
if (INF === $default) {
283+
if (\INF === $default) {
284284
return 'INF';
285285
}
286286

@@ -294,7 +294,7 @@ private function formatDefaultValue($default): string
294294
}
295295
}
296296

297-
return str_replace('\\\\', '\\', json_encode($default, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
297+
return str_replace('\\\\', '\\', json_encode($default, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE));
298298
}
299299

300300
/**

Formatter/OutputFormatter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function formatAndWrap(string $message, int $width)
138138
$output = '';
139139
$tagRegex = '[a-z][^<>]*+';
140140
$currentLineLength = 0;
141-
preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#ix", $message, $matches, PREG_OFFSET_CAPTURE);
141+
preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#ix", $message, $matches, \PREG_OFFSET_CAPTURE);
142142
foreach ($matches[0] as $i => $match) {
143143
$pos = $match[1];
144144
$text = $match[0];
@@ -196,7 +196,7 @@ private function createStyleFromString(string $string): ?OutputFormatterStyleInt
196196
return $this->styles[$string];
197197
}
198198

199-
if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', $string, $matches, PREG_SET_ORDER)) {
199+
if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', $string, $matches, \PREG_SET_ORDER)) {
200200
return null;
201201
}
202202

Helper/ProcessHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function run(OutputInterface $output, $cmd, $error = null, callable $call
5353
}
5454

5555
if (!\is_array($cmd)) {
56-
@trigger_error(sprintf('Passing a command as a string to "%s()" is deprecated since Symfony 4.2, pass it the command as an array of arguments instead.', __METHOD__), E_USER_DEPRECATED);
56+
@trigger_error(sprintf('Passing a command as a string to "%s()" is deprecated since Symfony 4.2, pass it the command as an array of arguments instead.', __METHOD__), \E_USER_DEPRECATED);
5757
$cmd = [method_exists(Process::class, 'fromShellCommandline') ? Process::fromShellCommandline($cmd) : new Process($cmd)];
5858
}
5959

Helper/ProgressBar.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ private function overwrite(string $message): void
454454
}
455455
}
456456
} elseif ($this->step > 0) {
457-
$message = PHP_EOL.$message;
457+
$message = \PHP_EOL.$message;
458458
}
459459

460460
$this->previousMessage = $originalMessage;
@@ -525,7 +525,7 @@ private static function initPlaceholderFormatters(): array
525525
return Helper::formatMemory(memory_get_usage(true));
526526
},
527527
'current' => function (self $bar) {
528-
return str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', STR_PAD_LEFT);
528+
return str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', \STR_PAD_LEFT);
529529
},
530530
'max' => function (self $bar) {
531531
return $bar->getMaxSteps();

Helper/QuestionHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private function doAsk(OutputInterface $output, Question $question)
105105
{
106106
$this->writePrompt($output, $question);
107107

108-
$inputStream = $this->inputStream ?: STDIN;
108+
$inputStream = $this->inputStream ?: \STDIN;
109109
$autocomplete = $question->getAutocompleterCallback();
110110

111111
if (\function_exists('sapi_windows_cp_set')) {

Helper/TableStyle.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class TableStyle
4646
private $cellRowFormat = '%s';
4747
private $cellRowContentFormat = ' %s ';
4848
private $borderFormat = '%s';
49-
private $padType = STR_PAD_RIGHT;
49+
private $padType = \STR_PAD_RIGHT;
5050

5151
/**
5252
* Sets padding character, used for cell padding.
@@ -112,7 +112,7 @@ public function setHorizontalBorderChars(string $outside, string $inside = null)
112112
*/
113113
public function setHorizontalBorderChar($horizontalBorderChar)
114114
{
115-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use setHorizontalBorderChars() instead.', __METHOD__), E_USER_DEPRECATED);
115+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use setHorizontalBorderChars() instead.', __METHOD__), \E_USER_DEPRECATED);
116116

117117
return $this->setHorizontalBorderChars($horizontalBorderChar, $horizontalBorderChar);
118118
}
@@ -126,7 +126,7 @@ public function setHorizontalBorderChar($horizontalBorderChar)
126126
*/
127127
public function getHorizontalBorderChar()
128128
{
129-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use getBorderChars() instead.', __METHOD__), E_USER_DEPRECATED);
129+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use getBorderChars() instead.', __METHOD__), \E_USER_DEPRECATED);
130130

131131
return $this->horizontalOutsideBorderChar;
132132
}
@@ -168,7 +168,7 @@ public function setVerticalBorderChars(string $outside, string $inside = null):
168168
*/
169169
public function setVerticalBorderChar($verticalBorderChar)
170170
{
171-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use setVerticalBorderChars() instead.', __METHOD__), E_USER_DEPRECATED);
171+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use setVerticalBorderChars() instead.', __METHOD__), \E_USER_DEPRECATED);
172172

173173
return $this->setVerticalBorderChars($verticalBorderChar, $verticalBorderChar);
174174
}
@@ -182,7 +182,7 @@ public function setVerticalBorderChar($verticalBorderChar)
182182
*/
183183
public function getVerticalBorderChar()
184184
{
185-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use getBorderChars() instead.', __METHOD__), E_USER_DEPRECATED);
185+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use getBorderChars() instead.', __METHOD__), \E_USER_DEPRECATED);
186186

187187
return $this->verticalOutsideBorderChar;
188188
}
@@ -270,7 +270,7 @@ public function setDefaultCrossingChar(string $char): self
270270
*/
271271
public function setCrossingChar($crossingChar)
272272
{
273-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1. Use setDefaultCrossingChar() instead.', __METHOD__), E_USER_DEPRECATED);
273+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1. Use setDefaultCrossingChar() instead.', __METHOD__), \E_USER_DEPRECATED);
274274

275275
return $this->setDefaultCrossingChar($crossingChar);
276276
}
@@ -413,7 +413,7 @@ public function getBorderFormat()
413413
*/
414414
public function setPadType($padType)
415415
{
416-
if (!\in_array($padType, [STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH], true)) {
416+
if (!\in_array($padType, [\STR_PAD_LEFT, \STR_PAD_RIGHT, \STR_PAD_BOTH], true)) {
417417
throw new InvalidArgumentException('Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).');
418418
}
419419

Input/InputDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function getArguments()
171171
*/
172172
public function getArgumentCount()
173173
{
174-
return $this->hasAnArrayArgument ? PHP_INT_MAX : \count($this->arguments);
174+
return $this->hasAnArrayArgument ? \PHP_INT_MAX : \count($this->arguments);
175175
}
176176

177177
/**

0 commit comments

Comments
 (0)