Skip to content

Commit

Permalink
Merge branch '4.4' into 5.2
Browse files Browse the repository at this point in the history
* 4.4:
  [Inflector][String] wrong plural form of words ending by "pectus"
  [HttpClient] Don't prepare the request in ScopingHttpClient
  [Console] Fixes for PHP 8.1 deprecations
  Fix/Rewrite .gitignore regex builder
  • Loading branch information
nicolas-grekas committed May 10, 2021
2 parents 5de9fba + 1ab187a commit 56813e5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Descriptor/TextDescriptor.php
Expand Up @@ -117,7 +117,7 @@ protected function describeInputDefinition(InputDefinition $definition, array $o

$this->writeText('<comment>Options:</comment>', $options);
foreach ($definition->getOptions() as $option) {
if (\strlen($option->getShortcut()) > 1) {
if (\strlen($option->getShortcut() ?? '') > 1) {
$laterOptions[] = $option;
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion Descriptor/XmlDescriptor.php
Expand Up @@ -200,7 +200,7 @@ private function getInputOptionDocument(InputOption $option): \DOMDocument

$dom->appendChild($objectXML = $dom->createElement('option'));
$objectXML->setAttribute('name', '--'.$option->getName());
$pos = strpos($option->getShortcut(), '|');
$pos = strpos($option->getShortcut() ?? '', '|');
if (false !== $pos) {
$objectXML->setAttribute('shortcut', '-'.substr($option->getShortcut(), 0, $pos));
$objectXML->setAttribute('shortcuts', '-'.str_replace('|', '|-', $option->getShortcut()));
Expand Down
2 changes: 1 addition & 1 deletion Helper/ProgressIndicator.php
Expand Up @@ -185,7 +185,7 @@ private function display()
}

return $matches[0];
}, $this->format));
}, $this->format ?? ''));
}

private function determineBestFormat(): string
Expand Down
2 changes: 1 addition & 1 deletion Helper/Table.php
Expand Up @@ -572,7 +572,7 @@ private function buildTableRows(array $rows): TableRows
if (isset($this->columnMaxWidths[$column]) && Helper::strlenWithoutDecoration($formatter, $cell) > $this->columnMaxWidths[$column]) {
$cell = $formatter->formatAndWrap($cell, $this->columnMaxWidths[$column] * $colspan);
}
if (!strstr($cell, "\n")) {
if (!strstr($cell ?? '', "\n")) {
continue;
}
$escaped = implode("\n", array_map([OutputFormatter::class, 'escapeTrailingBackslash'], explode("\n", $cell)));
Expand Down

0 comments on commit 56813e5

Please sign in to comment.