spiks/user-input-processor
最新稳定版本:0.10.1
Composer 安装命令:
composer require spiks/user-input-processor
包简介
Denormalizer and validator for any kind of user input.
README 文档
README
Denormalizes and validates any kind of user input, so it may be easily used in:
- HTML forms,
- APIs,
- console command arguments,
- ... and in a lot of other scenarios.
Installation
Warning: At this moment the library is being tested in real projects to detect possible problems in its design, so API changes are possible. Please wait for stable version.
PHP 8.1 or newer is required. The library is available in Packagist and may be installed with Composer:
composer require spiks/user-input-processor
Features
The main principles behind the library:
- Keep it simple. The library implements only necessary subset of features. It's easy to extend the library to add more. The library is designed as a base for your own implementation, it's not swiss knife that tries to do everything.
- Full type coverage for static analysis tools. Public API and the library internals follow the strictest rules of Psalm and PHPStan - most popular static analysis tools for PHP. We are designing the library keeping type safety in mind. You will appreciate it if you are using static analysis in your projects too.
Motivation
In our internal projects we use Symfony framework which offers Symfony Forms package for user input validation. Symfony Forms has a lot if disadvantages:
- Its internals are very complex,
- It's designed only for HTML forms, and it's not suitable for JSON APIs,
- It's pain to use Symfony Forms with static analysis tools,
- Difficult to maintain forms with complex logic within.
There aren't lots of alternative solutions for user input validation. That's why we decided to create our own.
Usage
This section will be written when we will be sure API and design is stable enough.
统计信息
- 总下载量: 76.12k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-11-22