Skip to content

Commit bc882da

Browse files
Merge branch '4.4' into 5.1
* 4.4: Enable "native_constant_invocation" CS rule Make AbstractPhpFileCacheWarmer public
2 parents 186f395 + 4044c64 commit bc882da

33 files changed

+104
-104
lines changed

Application.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ protected function doRenderThrowable(\Throwable $e, OutputInterface $output): vo
792792
}, $message);
793793
}
794794

795-
$width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : PHP_INT_MAX;
795+
$width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : \PHP_INT_MAX;
796796
$lines = [];
797797
foreach ('' !== $message ? preg_split('/\r?\n/', $message) : [] as $line) {
798798
foreach ($this->splitStringByWidth($line, $width - 4) as $line) {
@@ -1075,7 +1075,7 @@ private function findAlternatives(string $name, iterable $collection): array
10751075
}
10761076

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

10801080
return array_keys($alternatives);
10811081
}

Command/Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ public function run(InputInterface $input, OutputInterface $output)
226226
if (null !== $this->processTitle) {
227227
if (\function_exists('cli_set_process_title')) {
228228
if (!@cli_set_process_title($this->processTitle)) {
229-
if ('Darwin' === PHP_OS) {
229+
if ('Darwin' === \PHP_OS) {
230230
$output->writeln('<comment>Running "cli_set_process_title" as an unprivileged user is not supported on MacOS.</comment>', OutputInterface::VERBOSITY_VERY_VERBOSE);
231231
} else {
232232
cli_set_process_title($this->processTitle);

Cursor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class Cursor
2424
public function __construct(OutputInterface $output, $input = null)
2525
{
2626
$this->output = $output;
27-
$this->input = $input ?? (\defined('STDIN') ? STDIN : fopen('php://input', 'r+'));
27+
$this->input = $input ?? (\defined('STDIN') ? \STDIN : fopen('php://input', 'r+'));
2828
}
2929

3030
public function moveUp(int $lines = 1): self

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
@@ -136,7 +136,7 @@ public function formatAndWrap(?string $message, int $width)
136136
$output = '';
137137
$tagRegex = '[a-z][^<>]*+';
138138
$currentLineLength = 0;
139-
preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#ix", $message, $matches, PREG_OFFSET_CAPTURE);
139+
preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#ix", $message, $matches, \PREG_OFFSET_CAPTURE);
140140
foreach ($matches[0] as $i => $match) {
141141
$pos = $match[1];
142142
$text = $match[0];
@@ -194,7 +194,7 @@ private function createStyleFromString(string $string): ?OutputFormatterStyleInt
194194
return $this->styles[$string];
195195
}
196196

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

Helper/ProgressBar.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ private function overwrite(string $message): void
474474
}
475475
}
476476
} elseif ($this->step > 0) {
477-
$message = PHP_EOL.$message;
477+
$message = \PHP_EOL.$message;
478478
}
479479

480480
$this->previousMessage = $originalMessage;
@@ -533,7 +533,7 @@ private static function initPlaceholderFormatters(): array
533533
return Helper::formatMemory(memory_get_usage(true));
534534
},
535535
'current' => function (self $bar) {
536-
return str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', STR_PAD_LEFT);
536+
return str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', \STR_PAD_LEFT);
537537
},
538538
'max' => function (self $bar) {
539539
return $bar->getMaxSteps();

Helper/QuestionHelper.php

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

110-
$inputStream = $this->inputStream ?: STDIN;
110+
$inputStream = $this->inputStream ?: \STDIN;
111111
$autocomplete = $question->getAutocompleterCallback();
112112

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

Helper/TableStyle.php

Lines changed: 2 additions & 2 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.
@@ -319,7 +319,7 @@ public function getBorderFormat()
319319
*/
320320
public function setPadType(int $padType)
321321
{
322-
if (!\in_array($padType, [STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH], true)) {
322+
if (!\in_array($padType, [\STR_PAD_LEFT, \STR_PAD_RIGHT, \STR_PAD_BOTH], true)) {
323323
throw new InvalidArgumentException('Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).');
324324
}
325325

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)