[Console] OutputFormatter: move strtolower to createStyleFromString
While playing with the href feature that'll be available in 4.3, I spotted href value is lowercased. Which I guess could be an issue on case-sensitive filesystems. This changes nothing for the current branch, but will allow when merging to upper branches to fix the behavior described above, hence keep original case.
This commit is contained in:
parent
d1bf595bdf
commit
8e2bd35dca
@ -157,7 +157,7 @@ class OutputFormatter implements OutputFormatterInterface
|
|||||||
if (!$open && !$tag) {
|
if (!$open && !$tag) {
|
||||||
// </>
|
// </>
|
||||||
$this->styleStack->pop();
|
$this->styleStack->pop();
|
||||||
} elseif (false === $style = $this->createStyleFromString(strtolower($tag))) {
|
} elseif (false === $style = $this->createStyleFromString($tag)) {
|
||||||
$output .= $this->applyCurrentStyle($text);
|
$output .= $this->applyCurrentStyle($text);
|
||||||
} elseif ($open) {
|
} elseif ($open) {
|
||||||
$this->styleStack->push($style);
|
$this->styleStack->push($style);
|
||||||
@ -203,13 +203,14 @@ class OutputFormatter implements OutputFormatterInterface
|
|||||||
$style = new OutputFormatterStyle();
|
$style = new OutputFormatterStyle();
|
||||||
foreach ($matches as $match) {
|
foreach ($matches as $match) {
|
||||||
array_shift($match);
|
array_shift($match);
|
||||||
|
$match[0] = strtolower($match[0]);
|
||||||
|
|
||||||
if ('fg' == $match[0]) {
|
if ('fg' == $match[0]) {
|
||||||
$style->setForeground($match[1]);
|
$style->setForeground(strtolower($match[1]));
|
||||||
} elseif ('bg' == $match[0]) {
|
} elseif ('bg' == $match[0]) {
|
||||||
$style->setBackground($match[1]);
|
$style->setBackground(strtolower($match[1]));
|
||||||
} elseif ('options' === $match[0]) {
|
} elseif ('options' === $match[0]) {
|
||||||
preg_match_all('([^,;]+)', $match[1], $options);
|
preg_match_all('([^,;]+)', strtolower($match[1]), $options);
|
||||||
$options = array_shift($options);
|
$options = array_shift($options);
|
||||||
foreach ($options as $option) {
|
foreach ($options as $option) {
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user