Use CPP where possible

This commit is contained in:
Alexandre Daubois
2024-07-22 10:27:43 +02:00
parent 22e3436515
commit 43b48b2922
2 changed files with 7 additions and 10 deletions

View File

@@ -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

View File

@@ -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'));