{"id":33018427,"url":"https://github.com/rdohms/DMS-Filter","last_synced_at":"2025-11-16T14:00:37.199Z","repository":{"id":430531,"uuid":"2002314","full_name":"rdohms/dms-filter","owner":"rdohms","description":"Library that offers Input Filtering based on Annotations for use with Objects. Check out 2.dev for 2.0 pre-release.","archived":false,"fork":false,"pushed_at":"2024-09-25T23:44:11.000Z","size":1379,"stargazers_count":96,"open_issues_count":6,"forks_count":19,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-22T00:58:55.843Z","etag":null,"topics":["annotations","filtering","hacktoberfest","security"],"latest_commit_sha":null,"homepage":"http://doh.ms/project/list","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rdohms.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-07-05T19:16:57.000Z","updated_at":"2025-07-16T23:20:38.000Z","dependencies_parsed_at":"2024-11-30T21:06:32.760Z","dependency_job_id":"af135184-7e1f-43cd-8516-b7dd2aa64bba","html_url":"https://github.com/rdohms/dms-filter","commit_stats":{"total_commits":103,"total_committers":9,"mean_commits":"11.444444444444445","dds":"0.38834951456310685","last_synced_commit":"9cdbba378b2f30998f505448812be988eb99a36f"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/rdohms/dms-filter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdohms%2Fdms-filter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdohms%2Fdms-filter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdohms%2Fdms-filter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdohms%2Fdms-filter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rdohms","download_url":"https://codeload.github.com/rdohms/dms-filter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdohms%2Fdms-filter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284719042,"owners_count":27052182,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-16T02:00:05.974Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["annotations","filtering","hacktoberfest","security"],"created_at":"2025-11-13T18:00:39.568Z","updated_at":"2025-11-16T14:00:37.193Z","avatar_url":"https://github.com/rdohms.png","language":"PHP","funding_links":[],"categories":["过滤和验证","过滤和验证 Filtering and Validation","Filtering and Validation","过滤和验证( Filtering ang Validation )"],"sub_categories":[],"readme":"# DMS Filter Component\n\nThis library provides a service that can be used to filter object values based on annotations\n\n[![Latest Stable Version](https://poser.pugx.org/dms/dms-filter/v/stable.png)](https://packagist.org/packages/dms/dms-filter) [![Total Downloads](https://poser.pugx.org/dms/dms-filter/downloads.png)](https://packagist.org/packages/dms/dms-filter) [![Latest Unstable Version](https://poser.pugx.org/dms/dms-filter/v/unstable.png)](https://packagist.org/packages/dms/dms-filter) [![License](https://poser.pugx.org/dms/dms-filter/license.png)](https://packagist.org/packages/dms/dms-filter) [![SensioLabsInsight](https://insight.sensiolabs.com/projects/bb7f41c3-ee7c-4473-8fbf-806453a9e899/mini.png)](https://insight.sensiolabs.com/projects/bb7f41c3-ee7c-4473-8fbf-806453a9e899) [![Build Status](https://travis-ci.org/rdohms/dms-filter.png?branch=master)](https://travis-ci.org/rdohms/dms-filter)![Unit Tests](https://github.com/rdohms/dms-filter/workflows/Unit%20Tests/badge.svg)\n\n## Install\n\nUse composer to add DMS\\Filter to your app\n\n`composer require dms/dms-filter`\n\n## Usage\n\nYour Entity:\n\n```php\n\u003c?php\n\nnamespace App\\Entity;\n\n//Import Attributes\nuse DMS\\Filter\\Rules as Filter;\n\nclass User\n{\n    #[Filter\\StripTags]\n    #[Filter\\Trim]\n    #[Filter\\StripNewlines]\n    public string $name;\n\n    #[Filter\\StripTags]\n    #[Filter\\Trim]\n    #[Filter\\StripNewlines]\n    public string $email;\n}\n?\u003e\n```\n\nFiltering:\n```php\n\u003c?php\n    //Load AttributeLoader\n    $loader = new Mapping\\Loader\\AttributeLoader();\n\n    //Get a MetadataFactory\n    $metadataFactory = new Mapping\\ClassMetadataFactory($loader);\n\n    //Get a FilterLoader\n    $filterLoader = new \\DMS\\Filter\\Filters\\Loader\\FilterLoader();\n\n    //Get a Filter\n    $filter = new DMS\\Filter\\Filter($metadataFactory, $filterLoader);\n\n\n    //Get your Entity\n    $user = new App\\Entity\\User();\n    $user-\u003ename = \"My \u003cb\u003ename\u003c/b\u003e\";\n    $user-\u003eemail = \" email@mail.com\";\n\n    //Filter you entity\n    $filter-\u003efilterEntity($user);\n\n    echo $user-\u003ename; //\"My name\"\n    echo $user-\u003eemail; //\"email@mail.com\"\n?\u003e\n```\n## Contributing\n\nFeel free to send pull requests, just follow these guides:\n\n* Fork\n* Code\n* Test\n    * Just create FilterTestCase and run `phpunit`\n* Submit PR\n\n## Credits\n\nThis library is inspired by the Symfony 2 Validator component and is meant to work alongside it.\n\nSymfony Validator: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Validator\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdohms%2FDMS-Filter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frdohms%2FDMS-Filter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdohms%2FDMS-Filter/lists"}