QuestionHelper

class QuestionHelper extends Helper The QuestionHelper class provides helpers to interact with the user. Methods setHelperSet(HelperSet $helperSet = null) Sets the helper set associated with this helper. from Helper HelperSet getHelperSet() Gets the helper set associated with this helper. from Helper static int strlen(string $string) Returns the length of a string, using mb_strwidth if it is available. from Helper static formatTime($secs) from Helper static formatMemory(

Question::setValidator()

Question setValidator(callable $validator = null) Sets a validator for the question. Parameters callable $validator Return Value Question The current instance

Question::setAutocompleterValues()

Question setAutocompleterValues(null|array|Traversable $values) Sets values for the autocompleter. Parameters null|array|Traversable $values Return Value Question The current instance Exceptions InvalidArgumentException LogicException

Question::setHiddenFallback()

Question setHiddenFallback(bool $fallback) Sets whether to fallback on non-hidden question if the response can not be hidden. Parameters bool $fallback Return Value Question The current instance

Question::setHidden()

Question setHidden(bool $hidden) Sets whether the user response must be hidden or not. Parameters bool $hidden Return Value Question The current instance Exceptions LogicException In case the autocompleter is also used

Question::setNormalizer()

Question setNormalizer(callable $normalizer) Sets a normalizer for the response. The normalizer can be a callable (a string), a closure or a class implementing __invoke. Parameters callable $normalizer Return Value Question The current instance

Question::setMaxAttempts()

Question setMaxAttempts(null|int $attempts) Sets the maximum number of attempts. Null means an unlimited number of attempts. Parameters null|int $attempts Return Value Question The current instance Exceptions InvalidArgumentException In case the number of attempts is invalid.

Question::isHiddenFallback()

bool isHiddenFallback() In case the response can not be hidden, whether to fallback on non-hidden question or not. Return Value bool

Question::getMaxAttempts()

null|int getMaxAttempts() Gets the maximum number of attempts. Null means an unlimited number of attempts. Return Value null|int

Question::getQuestion()

string getQuestion() Returns the question. Return Value string