From df44c8fae06f17af2ef890cc2a02d3861cdc48d0 Mon Sep 17 00:00:00 2001 From: Alexandre Balmes Date: Thu, 18 Aug 2022 23:35:40 +0200 Subject: [PATCH] Update questionhelper.rst Fix typo for "Command::SUCCESS" --- components/console/helpers/questionhelper.rst | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/components/console/helpers/questionhelper.rst b/components/console/helpers/questionhelper.rst index 863120dd52f..d3e7498049b 100644 --- a/components/console/helpers/questionhelper.rst +++ b/components/console/helpers/questionhelper.rst @@ -88,7 +88,7 @@ if you want to know a bundle name, you can add this to your command:: // ... do something with the bundleName - return Commande::SUCCESS; + return Command::SUCCESS; } The user will be asked "Please enter the name of the bundle". They can type @@ -124,7 +124,7 @@ from a predefined list:: // ... do something with the color - return Commande::SUCCESS; + return Command::SUCCESS; } .. versionadded:: 5.2 @@ -166,7 +166,7 @@ this use :method:`Symfony\\Component\\Console\\Question\\ChoiceQuestion::setMult $colors = $helper->ask($input, $output, $question); $output->writeln('You have just selected: ' . implode(', ', $colors)); - return Commande::SUCCESS; + return Command::SUCCESS; } Now, when the user enters ``1,2``, the result will be: @@ -197,7 +197,7 @@ will be autocompleted as the user types:: // ... do something with the bundleName - return Commande::SUCCESS; + return Command::SUCCESS; } In more complex use cases, it may be necessary to generate suggestions on the @@ -236,7 +236,7 @@ provide a callback function to dynamically generate suggestions:: // ... do something with the filePath - return Commande::SUCCESS; + return Command::SUCCESS; } Do not Trim the Answer @@ -260,7 +260,7 @@ You can also specify if you want to not trim the answer by setting it directly w // ... do something with the name - return Commande::SUCCESS; + return Command::SUCCESS; } Accept Multiline Answers @@ -291,7 +291,7 @@ the response to a question should allow multiline answers by passing ``true`` to // ... do something with the answer - return Commande::SUCCESS; + return Command::SUCCESS; } Multiline questions stop reading user input after receiving an end-of-transmission @@ -319,7 +319,7 @@ convenient for passwords:: // ... do something with the password - return Commande::SUCCESS; + return Command::SUCCESS; } .. caution:: @@ -351,7 +351,7 @@ convenient for passwords:: // ... - return Commande::SUCCESS; + return Command::SUCCESS; } Normalizing the Answer @@ -382,7 +382,7 @@ method:: // ... do something with the bundleName - return Commande::SUCCESS; + return Command::SUCCESS; } .. caution:: @@ -426,7 +426,7 @@ method:: // ... do something with the bundleName - return Commande::SUCCESS; + return Command::SUCCESS; } The ``$validator`` is a callback which handles the validation. It should @@ -488,7 +488,7 @@ You can also use a validator with a hidden question:: // ... do something with the password - return Commande::SUCCESS; + return Command::SUCCESS; } Testing a Command that Expects Input