From e99177fb7d01559644f68ae77e431457ce74fbe8 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 29 Nov 2016 12:22:06 +0100 Subject: [PATCH] Added docs for ConsoleLogger::hasErrored() --- components/console/logger.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/components/console/logger.rst b/components/console/logger.rst index 207e7172daa..95511d33c3f 100644 --- a/components/console/logger.rst +++ b/components/console/logger.rst @@ -103,4 +103,15 @@ constructor:: ); $logger = new ConsoleLogger($output, array(), $formatLevelMap); +Errors +------ + +.. versionadded:: 3.2 + The ``hasErrored()`` method was introduced in Symfony 3.2. + +The Console logger includes a ``hasErrored()`` method which returns ``true`` as +soon as any error message has been logged during the execution of the command. +This is useful to decide which status code to return as the result of executing +the command. + .. _PSR-3: http://www.php-fig.org/psr/psr-3/