https://github.com/rdohms/DMS-Filter
Library that offers Input Filtering based on Annotations for use with Objects. Check out 2.dev for 2.0 pre-release.
https://github.com/rdohms/DMS-Filter
annotations filtering hacktoberfest security
Last synced: about 2 months ago
JSON representation
Library that offers Input Filtering based on Annotations for use with Objects. Check out 2.dev for 2.0 pre-release.
- Host: GitHub
- URL: https://github.com/rdohms/DMS-Filter
- Owner: rdohms
- License: mit
- Created: 2011-07-05T19:16:57.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2024-09-25T23:44:11.000Z (over 1 year ago)
- Last Synced: 2025-10-22T00:58:55.843Z (3 months ago)
- Topics: annotations, filtering, hacktoberfest, security
- Language: PHP
- Homepage: http://doh.ms/project/list
- Size: 1.32 MB
- Stars: 96
- Watchers: 4
- Forks: 19
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- awesome-php-cn - 官网
- awesome-php - rdohms/DMS-Filter - 一个基于标注的过滤库 (过滤和验证( Filtering ang Validation ))
README
# DMS Filter Component
This library provides a service that can be used to filter object values based on annotations
[](https://packagist.org/packages/dms/dms-filter) [](https://packagist.org/packages/dms/dms-filter) [](https://packagist.org/packages/dms/dms-filter) [](https://packagist.org/packages/dms/dms-filter) [](https://insight.sensiolabs.com/projects/bb7f41c3-ee7c-4473-8fbf-806453a9e899) [](https://travis-ci.org/rdohms/dms-filter)
## Install
Use composer to add DMS\Filter to your app
`composer require dms/dms-filter`
## Usage
Your Entity:
```php
```
Filtering:
```php
name = "My name";
$user->email = " email@mail.com";
//Filter you entity
$filter->filterEntity($user);
echo $user->name; //"My name"
echo $user->email; //"email@mail.com"
?>
```
## Contributing
Feel free to send pull requests, just follow these guides:
* Fork
* Code
* Test
* Just create FilterTestCase and run `phpunit`
* Submit PR
## Credits
This library is inspired by the Symfony 2 Validator component and is meant to work alongside it.
Symfony Validator: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Validator