Skip to content

Commit d78ff92

Browse files
committed
fixed CS
1 parent 7c641b0 commit d78ff92

File tree

2 files changed

+43
-43
lines changed

2 files changed

+43
-43
lines changed

Formatter/OutputFormatterStyle.php

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,40 +20,40 @@
2020
*/
2121
class OutputFormatterStyle implements OutputFormatterStyleInterface
2222
{
23-
private static $availableForegroundColors = array(
24-
'black' => array('set' => 30, 'unset' => 39),
25-
'red' => array('set' => 31, 'unset' => 39),
26-
'green' => array('set' => 32, 'unset' => 39),
27-
'yellow' => array('set' => 33, 'unset' => 39),
28-
'blue' => array('set' => 34, 'unset' => 39),
29-
'magenta' => array('set' => 35, 'unset' => 39),
30-
'cyan' => array('set' => 36, 'unset' => 39),
31-
'white' => array('set' => 37, 'unset' => 39),
32-
'default' => array('set' => 39, 'unset' => 39),
33-
);
34-
private static $availableBackgroundColors = array(
35-
'black' => array('set' => 40, 'unset' => 49),
36-
'red' => array('set' => 41, 'unset' => 49),
37-
'green' => array('set' => 42, 'unset' => 49),
38-
'yellow' => array('set' => 43, 'unset' => 49),
39-
'blue' => array('set' => 44, 'unset' => 49),
40-
'magenta' => array('set' => 45, 'unset' => 49),
41-
'cyan' => array('set' => 46, 'unset' => 49),
42-
'white' => array('set' => 47, 'unset' => 49),
43-
'default' => array('set' => 49, 'unset' => 49),
44-
);
45-
private static $availableOptions = array(
46-
'bold' => array('set' => 1, 'unset' => 22),
47-
'underscore' => array('set' => 4, 'unset' => 24),
48-
'blink' => array('set' => 5, 'unset' => 25),
49-
'reverse' => array('set' => 7, 'unset' => 27),
50-
'conceal' => array('set' => 8, 'unset' => 28),
51-
);
23+
private static $availableForegroundColors = [
24+
'black' => ['set' => 30, 'unset' => 39],
25+
'red' => ['set' => 31, 'unset' => 39],
26+
'green' => ['set' => 32, 'unset' => 39],
27+
'yellow' => ['set' => 33, 'unset' => 39],
28+
'blue' => ['set' => 34, 'unset' => 39],
29+
'magenta' => ['set' => 35, 'unset' => 39],
30+
'cyan' => ['set' => 36, 'unset' => 39],
31+
'white' => ['set' => 37, 'unset' => 39],
32+
'default' => ['set' => 39, 'unset' => 39],
33+
];
34+
private static $availableBackgroundColors = [
35+
'black' => ['set' => 40, 'unset' => 49],
36+
'red' => ['set' => 41, 'unset' => 49],
37+
'green' => ['set' => 42, 'unset' => 49],
38+
'yellow' => ['set' => 43, 'unset' => 49],
39+
'blue' => ['set' => 44, 'unset' => 49],
40+
'magenta' => ['set' => 45, 'unset' => 49],
41+
'cyan' => ['set' => 46, 'unset' => 49],
42+
'white' => ['set' => 47, 'unset' => 49],
43+
'default' => ['set' => 49, 'unset' => 49],
44+
];
45+
private static $availableOptions = [
46+
'bold' => ['set' => 1, 'unset' => 22],
47+
'underscore' => ['set' => 4, 'unset' => 24],
48+
'blink' => ['set' => 5, 'unset' => 25],
49+
'reverse' => ['set' => 7, 'unset' => 27],
50+
'conceal' => ['set' => 8, 'unset' => 28],
51+
];
5252

5353
private $foreground;
5454
private $background;
5555
private $href;
56-
private $options = array();
56+
private $options = [];
5757
private $handlesHrefGracefully;
5858

5959
/**
@@ -63,7 +63,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
6363
* @param string|null $background The style background color name
6464
* @param array $options The style options
6565
*/
66-
public function __construct(string $foreground = null, string $background = null, array $options = array())
66+
public function __construct(string $foreground = null, string $background = null, array $options = [])
6767
{
6868
if (null !== $foreground) {
6969
$this->setForeground($foreground);
@@ -167,7 +167,7 @@ public function unsetOption($option)
167167
*/
168168
public function setOptions(array $options)
169169
{
170-
$this->options = array();
170+
$this->options = [];
171171

172172
foreach ($options as $option) {
173173
$this->setOption($option);
@@ -183,8 +183,8 @@ public function setOptions(array $options)
183183
*/
184184
public function apply($text)
185185
{
186-
$setCodes = array();
187-
$unsetCodes = array();
186+
$setCodes = [];
187+
$unsetCodes = [];
188188

189189
if (null === $this->handlesHrefGracefully) {
190190
$this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR');

Tests/Formatter/OutputFormatterTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -256,15 +256,15 @@ public function testNotDecoratedFormatter(string $input, string $expectedNonDeco
256256

257257
public function provideDecoratedAndNonDecoratedOutput()
258258
{
259-
return array(
260-
array('<error>some error</error>', 'some error', "\033[37;41msome error\033[39;49m"),
261-
array('<info>some info</info>', 'some info', "\033[32msome info\033[39m"),
262-
array('<comment>some comment</comment>', 'some comment', "\033[33msome comment\033[39m"),
263-
array('<question>some question</question>', 'some question', "\033[30;46msome question\033[39;49m"),
264-
array('<fg=red>some text with inline style</>', 'some text with inline style', "\033[31msome text with inline style\033[39m"),
265-
array('<href=idea://open/?file=/path/SomeFile.php&line=12>some URL</>', 'some URL', "\033]8;;idea://open/?file=/path/SomeFile.php&line=12\033\\some URL\033]8;;\033\\"),
266-
array('<href=idea://open/?file=/path/SomeFile.php&line=12>some URL</>', 'some URL', 'some URL', 'JetBrains-JediTerm'),
267-
);
259+
return [
260+
['<error>some error</error>', 'some error', "\033[37;41msome error\033[39;49m"],
261+
['<info>some info</info>', 'some info', "\033[32msome info\033[39m"],
262+
['<comment>some comment</comment>', 'some comment', "\033[33msome comment\033[39m"],
263+
['<question>some question</question>', 'some question', "\033[30;46msome question\033[39;49m"],
264+
['<fg=red>some text with inline style</>', 'some text with inline style', "\033[31msome text with inline style\033[39m"],
265+
['<href=idea://open/?file=/path/SomeFile.php&line=12>some URL</>', 'some URL', "\033]8;;idea://open/?file=/path/SomeFile.php&line=12\033\\some URL\033]8;;\033\\"],
266+
['<href=idea://open/?file=/path/SomeFile.php&line=12>some URL</>', 'some URL', 'some URL', 'JetBrains-JediTerm'],
267+
];
268268
}
269269

270270
public function testContentWithLineBreaks()

0 commit comments

Comments
 (0)