From 204cd739d34ad2c062d68802aa4c87ddb0dc24c4 Mon Sep 17 00:00:00 2001 From: Tito Costa Date: Thu, 25 Jun 2020 12:05:17 +0200 Subject: [PATCH 1/2] added info method to symfony style --- src/Symfony/Component/Console/Style/SymfonyStyle.php | 8 ++++++++ .../Fixtures/Style/SymfonyStyle/command/command_2.php | 1 + .../Tests/Fixtures/Style/SymfonyStyle/output/output_2.txt | 2 ++ 3 files changed, 11 insertions(+) diff --git a/src/Symfony/Component/Console/Style/SymfonyStyle.php b/src/Symfony/Component/Console/Style/SymfonyStyle.php index 271752f1444e6..290d6d55ec85f 100644 --- a/src/Symfony/Component/Console/Style/SymfonyStyle.php +++ b/src/Symfony/Component/Console/Style/SymfonyStyle.php @@ -163,6 +163,14 @@ public function note($message) $this->block($message, 'NOTE', 'fg=yellow', ' ! '); } + /** + * {@inheritdoc} + */ + public function info($message) + { + $this->block($message, 'INFO', 'fg=green', ' ', true); + } + /** * {@inheritdoc} */ diff --git a/src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/command/command_2.php b/src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/command/command_2.php index 791b626f24f48..a16ad505d2bc4 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/command/command_2.php +++ b/src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/command/command_2.php @@ -12,5 +12,6 @@ $output->error('Error'); $output->success('Success'); $output->note('Note'); + $output->info('Info'); $output->block('Custom block', 'CUSTOM', 'fg=white;bg=green', 'X ', true); }; diff --git a/src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/output/output_2.txt b/src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/output/output_2.txt index ca609760cc12a..9513b862f7492 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/output/output_2.txt +++ b/src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/output/output_2.txt @@ -9,5 +9,7 @@ ! [NOTE] Note + [INFO] Info + X [CUSTOM] Custom block From 4cf1a1e8e684d52bf57e0e67ec216764bc9a9dd2 Mon Sep 17 00:00:00 2001 From: Tito Miguel Costa Date: Sun, 28 Jun 2020 15:18:51 +0200 Subject: [PATCH 2/2] fixed docblock --- src/Symfony/Component/Console/Style/SymfonyStyle.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Console/Style/SymfonyStyle.php b/src/Symfony/Component/Console/Style/SymfonyStyle.php index 290d6d55ec85f..0d32763a0ff4f 100644 --- a/src/Symfony/Component/Console/Style/SymfonyStyle.php +++ b/src/Symfony/Component/Console/Style/SymfonyStyle.php @@ -164,7 +164,9 @@ public function note($message) } /** - * {@inheritdoc} + * Formats an info message. + * + * @param string|array $message */ public function info($message) {