Where $optionalFilter can be used to process input (eg. create the account number object) and throw exceptions on invalid input (catching exceptions can trigger re-asks in interactive mode).
InteractiveOptionReader as a subclass of OptionReader. Choose implementation at setup in DIC.
We also need to pass a description phrase to display in interactive mode when asking questions
("please write a valid account number...").
As a last touch option names and descriptions should be saved in some kind of tabular way so that the same phrases are not to be written in both configure() and execute().
We want
InitCommand
,AddCommand
,EditCommand
and maybe more to read options and/or interactively ask for user input. Requirements:Can be solved using an
OptionReader
(injected at construct) with the following interface:Where
$optionalFilter
can be used to process input (eg. create the account number object) and throw exceptions on invalid input (catching exceptions can trigger re-asks in interactive mode).InteractiveOptionReader
as a subclass ofOptionReader
. Choose implementation at setup in DIC.It should for example be possible to do this
As a last touch option names and descriptions should be saved in some kind of tabular way so that the same phrases are not to be written in both
configure()
andexecute()
.