Releases: phpgt/Input
Improve API design while moving towards FileUpload support
Two issues have come together to drastically improve the library:
FileUpload support is required now that key-value-pairs work.
An improvement to how callbacks are triggered required refactoring.
This update includes a large refactor compromising mainly of the following:
Classes broken out into more granular parts.
Namespaces bundle similar classes together.
All user input types, including FileUpload, extend common base class AbstractInputData.
All values of user input are handled as InputDatum instances.
API changes
As unit test coverage increases, APIs change.
The Input class itself shares its data access methods with the InputData class for ease of use and quick on-the-fly data access.
Accessing data is done using ArrayAccess now, rather than property access, due to the StyleGuide specifying "Only properties should be used when a predefined set of data attributes can be determined".
Input class fully tested
The basics are working. The Input class can be constructed from the $_GET, $_POST and $_FILES arrays. with(), without(), withAll() have been tested when calling them on the Input class themselves, and the correct callbacks are called.