style(teamcity): fix styling

This commit is contained in:
Oliver Nybroe
2020-07-28 10:51:57 +02:00
parent 75f17bb118
commit fa413aafbb
3 changed files with 80 additions and 33 deletions

View File

@ -12,6 +12,11 @@ use Pest\TeamCity;
*/
final class AddsDefaults
{
/**
* @var string
*/
private const PRINTER = 'printer';
/**
* Adds default arguments to the given `arguments` array.
*
@ -21,12 +26,12 @@ final class AddsDefaults
*/
public static function to(array $arguments): array
{
if (!array_key_exists('printer', $arguments)) {
$arguments['printer'] = new Printer(null, $arguments['verbose'] ?? false, $arguments['colors'] ?? 'always');
if (!array_key_exists(self::PRINTER, $arguments)) {
$arguments[self::PRINTER] = new Printer(null, $arguments['verbose'] ?? false, $arguments['colors'] ?? 'always');
}
if ($arguments['printer'] === \PHPUnit\Util\Log\TeamCity::class) {
$arguments['printer'] = new TeamCity(null, $arguments['verbose'] ?? false, $arguments['colors'] ?? 'always');
if ($arguments[self::PRINTER] === \PHPUnit\Util\Log\TeamCity::class) {
$arguments[self::PRINTER] = new TeamCity(null, $arguments['verbose'] ?? false, $arguments['colors'] ?? 'always');
}
return $arguments;