classCommandLine
final class CommandLine
Declares the commands, their options and the global options of the command line.
Methods§
public function create(): ApplicationCreates the console application; it neither exits nor catches exceptions itself.
Returns
Application The application with every command registeredTest cases 9
CommandLineTest::testCreateDeclaresTheGlobalOptionscallsCommandLineTest::testCreateNamesTheApplicationAndLeavesExitAndErrorsToTheCallercallsCommandLineTest::testCreateRegistersEveryCommandcallsCommandLineTest::testCreateRunsACommandThroughItsHandlercallsOverviewTest::testRequestedLeavesTheInputUnboundcallsOverviewTest::testRequestedTellsWhetherTheOverviewIsAskedForcallsOverviewTest::testShowDescribesTheApplicationcallsOverviewTest::testShowHonorsQuietcallsOverviewTest::testShowHonorsTheDecorationOptionscalls
Called from 1
Calls 9
- new
Applicationline 23 - method-call
Application::setAutoExit()line 24 - method-call
Application::setCatchExceptions()line 25 - method-call
Application::getDefinition()line 26 - new
InputOptionline 27 - class-const
InputOption::VALUE_NONE()line 27 - class-const
InputOption::VALUE_REQUIRED()line 28 - method-call
Application::add()line 38 - method-call CommandLine::command() line 38
public function command(string $name, string $description): CommandDeclares one command with its options and handler.
Parameters
$name | string | The command name |
$description | string | The one-line description shown in the overview |
Returns
Command The commandTest cases 3
Called from 1
Calls 9
- new
Commandline 53 - method-call
Command::setDescription()line 54 - method-call
Command::setHelp()line 55 - static-call Options::definitions() line 56
- method-call
Command::addOption()line 57 - class-const
InputOption::VALUE_NONE()line 57 - class-const
InputOption::VALUE_REQUIRED()line 57 - method-call
Command::setCode()line 59 - new CommandHandler line 59
Test cases 17§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 7
CommandLineTest::testCommandDeclaresFlagsWithoutValuesAndOtherOptionsWithRequiredValuescallsCommandLineTest::testCommandDeclaresTheNameDescriptionAndHelpcallsCommandLineTest::testCommandDeclaresTheOptionsOfTheCommandcallsCommandLineTest::testCreateDeclaresTheGlobalOptionscallsCommandLineTest::testCreateNamesTheApplicationAndLeavesExitAndErrorsToTheCallercallsCommandLineTest::testCreateRegistersEveryCommandcallsCommandLineTest::testCreateRunsACommandThroughItsHandlercalls
Other tests reaching this symbol 10
CommandsTestcallsExtensionCommandTestcallsMarkdownCommandTestcallsSpecCommandTestcallsApplicationTestcallsOverviewTest::testRequestedLeavesTheInputUnboundcallsOverviewTest::testRequestedTellsWhetherTheOverviewIsAskedForcallsOverviewTest::testShowDescribesTheApplicationcallsOverviewTest::testShowHonorsQuietcallsOverviewTest::testShowHonorsTheDecorationOptionscalls