Skip to content

michaelpetri/typed-input

Repository files navigation

Typed Input

Type Coverage Latest Stable Version License

Installation

composer require michaelpetri/typed-input 

Usage

$typedInput = TypedInput::fromInput($input);

echo $typedInput->getOption('my-option')->asNonEmptyString();
echo $typedInput->getArgument('my-argument')->asInteger();

Available methods

  • asBoolean
  • asBooleanOrNull
  • asInteger
  • asIntegerOrNull
  • asPositiveInteger
  • asPositiveIntegerOrNull
  • asNaturalInteger
  • asNaturalIntegerOrNull
  • asString
  • asStringOrNull
  • asNonEmptyString
  • asNonEmptyStringOrNull
  • asNonEmptyStrings
  • asDateTimeImmutable

About

Type safe input wrapper for symfony input

Topics

Resources

License

Stars

Watchers

Forks

Contributors 7

Languages