Skip to content

Commit 839cf60

Browse files
authored
chore(console): styling improvements (#819)
1 parent 420e5d8 commit 839cf60

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

src/Tempest/Console/src/GenericConsole.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function warning(string $line, ?string $symbol = null): self
157157

158158
public function success(string $line, ?string $symbol = null): self
159159
{
160-
$symbol ??= '✔︎';
160+
$symbol ??= '';
161161

162162
$this->writeln("<style=\"bg-dark-green fg-white\"> {$symbol} </style> <style=\"fg-green\">{$line}</style>");
163163

src/Tempest/Console/src/Middleware/OverviewMiddleware.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ private function renderOverview(bool $showHidden = false): void
7979
->toString();
8080

8181
$this->console
82-
->writeln()
8382
->writeln()
8483
->writeln($title);
8584

@@ -91,7 +90,7 @@ private function renderOverview(bool $showHidden = false): void
9190
$this->console
9291
->unless(
9392
condition: $this->discoveryCache->isValid(),
94-
callback: fn (Console $console) => $console->writeln(PHP_EOL . '<error>Discovery cache invalid. Run discovery:generate to enable discovery caching.</error>'),
93+
callback: fn (Console $console) => $console->writeln()->error('Discovery cache invalid. Run discovery:generate to enable discovery caching.'),
9594
);
9695
}
9796
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Tests\Tempest\Fixtures\Console;
6+
7+
use Tempest\Console\ConsoleCommand;
8+
use Tempest\Console\HasConsole;
9+
10+
final readonly class StylingCommand
11+
{
12+
use HasConsole;
13+
14+
#[ConsoleCommand(name: 'test:style')]
15+
public function __invoke(): void
16+
{
17+
$this
18+
->info('info')
19+
->success('success')
20+
->warning('warning')
21+
->error('error');
22+
}
23+
}

0 commit comments

Comments
 (0)