Skip to content

Type safe input wrapper for symfony input

License

Notifications You must be signed in to change notification settings

michaelpetri/typed-input

Folders and files

NameName
Last commit message
Last commit date
Jan 3, 2022
Feb 15, 2022
Sep 8, 2023
Feb 15, 2022
Jan 28, 2025
Mar 20, 2023
Jun 26, 2021
Mar 20, 2023
Jul 16, 2020
Sep 28, 2023
Jan 28, 2025
Apr 16, 2025
Apr 19, 2023
Feb 23, 2022

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