Skip to content

Commit d3314ce

Browse files
committed
format tests codes
1 parent 4fd544b commit d3314ce

File tree

6 files changed

+49
-14
lines changed

6 files changed

+49
-14
lines changed

src/ColorCode.php

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,26 +193,35 @@ public function __construct($fg = '', $bg = '', array $options = [], bool $extra
193193
{
194194
if ($fg) {
195195
if (!isset(self::KNOWN_COLORS[$fg])) {
196-
throw new InvalidArgumentException(sprintf('Invalid foreground color "%1$s" [%2$s]', $fg,
197-
implode(', ', self::getKnownColors())));
196+
throw new InvalidArgumentException(sprintf(
197+
'Invalid foreground color "%1$s" [%2$s]',
198+
$fg,
199+
implode(', ', self::getKnownColors())
200+
));
198201
}
199202

200203
$this->fgColor = ($extra ? self::FG_EXTRA : self::FG_BASE) + self::KNOWN_COLORS[$fg];
201204
}
202205

203206
if ($bg) {
204207
if (!isset(self::KNOWN_COLORS[$bg])) {
205-
throw new InvalidArgumentException(sprintf('Invalid background color "%1$s" [%2$s]', $bg,
206-
implode(', ', self::getKnownColors())));
208+
throw new InvalidArgumentException(sprintf(
209+
'Invalid background color "%1$s" [%2$s]',
210+
$bg,
211+
implode(', ', self::getKnownColors())
212+
));
207213
}
208214

209215
$this->bgColor = ($extra ? self::BG_EXTRA : self::BG_BASE) + self::KNOWN_COLORS[$bg];
210216
}
211217

212218
foreach ($options as $option) {
213219
if (!isset(self::KNOWN_OPTIONS[$option])) {
214-
throw new InvalidArgumentException(sprintf('Invalid option "%1$s" [%2$s]', $option,
215-
implode(', ', self::getKnownOptions())));
220+
throw new InvalidArgumentException(sprintf(
221+
'Invalid option "%1$s" [%2$s]',
222+
$option,
223+
implode(', ', self::getKnownOptions())
224+
));
216225
}
217226

218227
$this->options[] = $option;

test/ColorCodeTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
<?php declare(strict_types=1);
2+
/**
3+
* This file is part of toolkit/cli-utils.
4+
*
5+
* @link https://github.com/inhere
6+
* @author https://github.com/inhere
7+
* @license MIT
8+
*/
29

310
namespace Toolkit\CliTest;
411

test/ColorTagTest.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
<?php
1+
<?php declare(strict_types=1);
22
/**
3-
* Created by PhpStorm.
4-
* User: inhere
5-
* Date: 2019-01-08
6-
* Time: 00:01
3+
* This file is part of toolkit/cli-utils.
4+
*
5+
* @link https://github.com/inhere
6+
* @author https://github.com/inhere
7+
* @license MIT
78
*/
89

910
namespace Toolkit\CliTest;

test/ColorTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
<?php
1+
<?php declare(strict_types=1);
2+
/**
3+
* This file is part of toolkit/cli-utils.
4+
*
5+
* @link https://github.com/inhere
6+
* @author https://github.com/inhere
7+
* @license MIT
8+
*/
29

310
namespace Toolkit\CliTest;
411

test/FlagsTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
<?php declare(strict_types=1);
2+
/**
3+
* This file is part of toolkit/cli-utils.
4+
*
5+
* @link https://github.com/inhere
6+
* @author https://github.com/inhere
7+
* @license MIT
8+
*/
29

310
namespace Toolkit\CliTest;
411

test/boot.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
<?php
1+
<?php declare(strict_types=1);
22
/**
3-
* phpunit
3+
* This file is part of toolkit/cli-utils.
4+
*
5+
* @link https://github.com/inhere
6+
* @author https://github.com/inhere
7+
* @license MIT
48
*/
59

610
error_reporting(E_ALL);

0 commit comments

Comments
 (0)