Skip to content

Releases: PhpGt/Input

"or" function

08 Jul 13:44
bf1d707
Compare
Choose a tag to compare

On top of the call functionality, it is now possible to set a callback function to call when the current input trigger is not triggered.

Improved consistency

08 Apr 15:19
53f0075
Compare
Choose a tag to compare

No new features have been added since v0.4, only consistency improvements. After resolving the final v1 issues from the issue tracker, today marks the release of v1 of the PHP.Gt/Input repository.

Main improvements are:

  • Implementation of PSR 7's UploadedFileInterface, allowing interoperability between other areas of PHP.Gt using the PHP.Gt/Http repository.
  • asArray - naming compatibility with other PHP.Gt repositories.
  • The Input class is now mutable, allowing extra parameters to be added after initial construction. InputData classes are still immutable, so this allows the framework to add properties without exposing the functionality to user code.
  • Return types of all get* functions are improved for readability and predictability.

File upload improvements

23 Nov 13:45
Compare
Choose a tag to compare
Pre-release

Simplification of how Input handles file uploads. There will probably be more small changes made as the FileUpload classes are tested fully.

The InputValueGetter trait has also been introduced, which allows the Input class to be used as if it were InputData itself.

Improvements to two key functions

10 May 22:00
7f767fe
Compare
Choose a tag to compare
Pre-release

Test coverage has been improved, along with improvements to two key functions:

  • Instead of just has, the new hasValue function is introduced (issue #17)
  • The when function can be set to trigger on just a key's presence, rather than a key's value (issue #15)

Multiple value parameter support (array fields)

01 Mar 00:06
77bf6ab
Compare
Choose a tag to compare

This is the final new feature towards v1 release.

It adds support for array fields using square-bracket notation.

More tests will be written and example applications will be created before v1 release.

General API improvements

27 Feb 22:40
Compare
Choose a tag to compare
Pre-release
  • More meaningful exceptions thrown.
  • Tests' data providers improved.
  • All parameters passed if there is no when in the trigger.
  • Different parameter types can be cast using getter functions on InputData.

FileUpload support

24 Feb 11:56
b68e580
Compare
Choose a tag to compare
FileUpload support Pre-release
Pre-release

The main changes in this release consist of the way the three array-like objects are handled internally; QueryStringInputData, BodyInputData and FileUploadInputData now all extend the same base class, InputData allowing a consistent API with extended functionality where necessary.

FileUploadInputData is a new array-like object used to access the user-uploaded files, introduced by this release. The object unwraps the $_FILES superglobal into a data structure that makes sense, finally representing the individual files as FileUpload objects.

Improve API design while moving towards FileUpload support

23 Feb 19:25
21d2477
Compare
Choose a tag to compare

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

02 Dec 15:55
Compare
Choose a tag to compare
API changes Pre-release
Pre-release

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

01 Dec 15:26
Compare
Choose a tag to compare
Pre-release

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.