mirror of
https://github.com/symfony/console.git
synced 2026-03-24 01:12:13 +01:00
Use CPP where possible
This commit is contained in:
@@ -20,8 +20,6 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
*/
|
||||
class GithubActionReporter
|
||||
{
|
||||
private OutputInterface $output;
|
||||
|
||||
/**
|
||||
* @see https://github.com/actions/toolkit/blob/5e5e1b7aacba68a53836a34db4a288c3c1c1585b/packages/core/src/command.ts#L80-L85
|
||||
*/
|
||||
@@ -42,9 +40,9 @@ class GithubActionReporter
|
||||
',' => '%2C',
|
||||
];
|
||||
|
||||
public function __construct(OutputInterface $output)
|
||||
{
|
||||
$this->output = $output;
|
||||
public function __construct(
|
||||
private OutputInterface $output,
|
||||
) {
|
||||
}
|
||||
|
||||
public static function isGithubActionEnvironment(): bool
|
||||
|
||||
@@ -23,7 +23,6 @@ use function Symfony\Component\String\b;
|
||||
*/
|
||||
class OutputFormatter implements WrappableOutputFormatterInterface
|
||||
{
|
||||
private bool $decorated;
|
||||
private array $styles = [];
|
||||
private OutputFormatterStyleStack $styleStack;
|
||||
|
||||
@@ -67,10 +66,10 @@ class OutputFormatter implements WrappableOutputFormatterInterface
|
||||
*
|
||||
* @param OutputFormatterStyleInterface[] $styles Array of "name => FormatterStyle" instances
|
||||
*/
|
||||
public function __construct(bool $decorated = false, array $styles = [])
|
||||
{
|
||||
$this->decorated = $decorated;
|
||||
|
||||
public function __construct(
|
||||
private bool $decorated = false,
|
||||
array $styles = [],
|
||||
) {
|
||||
$this->setStyle('error', new OutputFormatterStyle('white', 'red'));
|
||||
$this->setStyle('info', new OutputFormatterStyle('green'));
|
||||
$this->setStyle('comment', new OutputFormatterStyle('yellow'));
|
||||
|
||||
Reference in New Issue
Block a user