From 89828678a7443848962d380b31980e22d893c75b Mon Sep 17 00:00:00 2001 From: gary houbre Date: Fri, 27 Nov 2020 12:49:56 +0100 Subject: [PATCH 1/2] Added Invalid Constant --- console.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/console.rst b/console.rst index 34dc50003f9..246ae474d48 100644 --- a/console.rst +++ b/console.rst @@ -57,6 +57,10 @@ want a command to create a user:: // or return this if some error happened during the execution // (it's equivalent to returning int(1)) // return Command::FAILURE; + + // or return this if there was invalid value during the execution + // (it's equivalent to returning int(2)) + // return Command::INVALID } } @@ -65,6 +69,10 @@ want a command to create a user:: The ``Command::SUCCESS`` and ``Command::FAILURE`` constants were introduced in Symfony 5.1. +.. versionadded:: 5.3 + + The ``Command::INVALID`` constants was introduced in Symfony 5.3 + Configuring the Command ----------------------- From d41389ad85d4812423919a7c8c1f8163006c1f38 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 27 Nov 2020 13:34:18 +0100 Subject: [PATCH 2/2] Tweak --- console.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/console.rst b/console.rst index 246ae474d48..58708719974 100644 --- a/console.rst +++ b/console.rst @@ -58,8 +58,8 @@ want a command to create a user:: // (it's equivalent to returning int(1)) // return Command::FAILURE; - // or return this if there was invalid value during the execution - // (it's equivalent to returning int(2)) + // or return this to indicate incorrect command usage; e.g. invalid options + // or missing arguments (it's equivalent to returning int(2)) // return Command::INVALID } } @@ -71,7 +71,7 @@ want a command to create a user:: .. versionadded:: 5.3 - The ``Command::INVALID`` constants was introduced in Symfony 5.3 + The ``Command::INVALID`` constant was introduced in Symfony 5.3 Configuring the Command -----------------------