mireiawen/input

Input parsers for $_POST, $_GET, $_SESSION and $_ENV

1.2.0 2022-06-16 21:13 UTC

This package is auto-updated.

Last update: 2024-04-17 01:27:24 UTC


README

Simple set of classes to allow reading of PHP input arrays $_GET, $_POST, $_ENV and $_SESSION

The classes have methods to read the values as different types and either cast the value to type, or throw exception of class Type if the value in the input array is not of correct type.

The methods will also throw MissingValue -exception if the value does not exist and no default value is given.

Requirements

  • Intl extension
  • PHP 7.3

Installation

You can clone or download the code from the GitHub repository or you can use composer: composer require mireiawen/input