stubbles / input
Stubbles Input enables to handle input data via validation and filtering.
Installs: 2 718
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 2
Open Issues: 2
Requires
- php: ^8.2
- ext-iconv: *
- ext-json: *
- stubbles/reflect: ^10.0
- stubbles/values: ^11.0
Requires (Dev)
- bovigo/assert: ^8.0
- bovigo/callmap: ^8.0
- mikey179/vfsstream: ^1.6.11
- phpunit/phpunit: ^10.5
- stubbles/date: ^9.0
- stubbles/peer: ^10.0
Suggests
- stubbles/date: To filter input params as date or datespan instances.
- stubbles/peer: To filter input params as instances of stubbles\peer\http\HttpUri
- dev-main
- v9.0.0
- v8.0.2
- v8.0.1
- v8.0.0
- v7.0.0
- v6.0.0
- v5.2.1
- v5.2.0
- v5.1.0
- v5.0.0
- v4.5.0
- v4.4.0
- v4.3.0
- v4.2.0
- v4.1.1
- v4.1.0
- v4.0.0
- v3.2.0
- v3.1.1
- v3.1.0
- v3.0.2
- v3.0.1
- v3.0.0
- v2.5.1
- v2.5.0
- v2.4.1
- v2.4.0
- v2.3.3
- v2.3.2
- v2.3.1
- v2.3.0
- v2.2.1
- v2.2.0
- v2.1.0
- v2.0.2
- v2.0.1
- v2.0.0
- v2.0.0-beta1
- dev-dependabot/composer/phpunit/phpunit-10.5.24
This package is auto-updated.
Last update: 2024-12-01 00:09:30 UTC
README
One of the most common task in applications is to read, validate and filter input data. stubbles/input provides means to do exactly that, by providing a Request API in order to validate and filter input values.
Build status
Installation
stubbles/input is distributed as Composer package. To install it as a dependency of your package use the following command:
composer require "stubbles/input": "^9.0"
Requirements
stubbles/input requires at least PHP 8.2.
Request parameters
The Request API provides access to request parameters in different ways:
getParamNames(): array
Returns a list of all parameter names.
paramErrors(): ParamErrors
Returns a list of all parameter errors that occurred during reading single request parameters.
hasParam(string $paramName): bool
Checks if a parameter with the given name is present in the current request.
validateParam(string $paramName): ValueValidator
Returns a value validator with methods that can be used to check if the parameter with the given name is valid.
See validate parameters details.
readParam(string $paramName): ValueReader
Returns a value reader that can be used to read the parameter with the given
name. In case the parameter does not exist the reader will return null
.