From 224f3e385b110fcc1f4e5be33e6b7f358c10f769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Sun, 11 Jul 2021 12:26:00 +0200 Subject: [PATCH] [Console] Add method `__toString()` to `InputInterface` --- src/Symfony/Component/Console/CHANGELOG.md | 5 +++++ src/Symfony/Component/Console/Input/InputInterface.php | 3 +++ .../Console/Tests/EventListener/ErrorListenerTest.php | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/src/Symfony/Component/Console/CHANGELOG.md b/src/Symfony/Component/Console/CHANGELOG.md index 9a93c7991de89..e7f9325125c25 100644 --- a/src/Symfony/Component/Console/CHANGELOG.md +++ b/src/Symfony/Component/Console/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +6.1 +--- + + * Add method `__toString()` to `InputInterface` + 6.0 --- diff --git a/src/Symfony/Component/Console/Input/InputInterface.php b/src/Symfony/Component/Console/Input/InputInterface.php index 024da1884eacb..3af991a76fbb8 100644 --- a/src/Symfony/Component/Console/Input/InputInterface.php +++ b/src/Symfony/Component/Console/Input/InputInterface.php @@ -18,6 +18,9 @@ * InputInterface is the interface implemented by all input classes. * * @author Fabien Potencier + * + * @method string __toString() Returns a stringified representation of the args passed to the command. + * InputArguments MUST be escaped as well as the InputOption values passed to the command. */ interface InputInterface { diff --git a/src/Symfony/Component/Console/Tests/EventListener/ErrorListenerTest.php b/src/Symfony/Component/Console/Tests/EventListener/ErrorListenerTest.php index becc9e5405c46..6ad89dc522692 100644 --- a/src/Symfony/Component/Console/Tests/EventListener/ErrorListenerTest.php +++ b/src/Symfony/Component/Console/Tests/EventListener/ErrorListenerTest.php @@ -143,4 +143,9 @@ public function getParameterOption($values, $default = false, $onlyParams = fals public function parse() { } + + public function __toString(): string + { + return ''; + } }