{"id":22665149,"url":"https://github.com/br0ken-/reflection-validator","last_synced_at":"2025-04-12T08:33:11.767Z","repository":{"id":48483137,"uuid":"99015347","full_name":"BR0kEN-/reflection-validator","owner":"BR0kEN-","description":"Define a specification of PHP entity and check whether the particular item matches it.","archived":false,"fork":false,"pushed_at":"2021-07-23T10:51:40.000Z","size":23,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T03:41:33.559Z","etag":null,"topics":["php","php7","reflection","reflection-library","validation","validator"],"latest_commit_sha":null,"homepage":null,"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/BR0kEN-.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-01T15:19:53.000Z","updated_at":"2022-02-12T12:45:45.000Z","dependencies_parsed_at":"2022-09-26T22:11:27.589Z","dependency_job_id":null,"html_url":"https://github.com/BR0kEN-/reflection-validator","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BR0kEN-%2Freflection-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BR0kEN-%2Freflection-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BR0kEN-%2Freflection-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BR0kEN-%2Freflection-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BR0kEN-","download_url":"https://codeload.github.com/BR0kEN-/reflection-validator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248540462,"owners_count":21121362,"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","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":["php","php7","reflection","reflection-library","validation","validator"],"created_at":"2024-12-09T13:19:47.227Z","updated_at":"2025-04-12T08:33:11.740Z","avatar_url":"https://github.com/BR0kEN-.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reflection Validator\n\n[![Build Status](https://img.shields.io/travis/BR0kEN-/reflection-validator/master.svg?style=flat-square)](https://travis-ci.org/BR0kEN-/reflection-validator)\n[![Code coverage](https://img.shields.io/scrutinizer/coverage/g/BR0kEN-/reflection-validator/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/BR0kEN-/reflection-validator/?branch=master)\n[![Quality Score](https://img.shields.io/scrutinizer/g/BR0kEN-/reflection-validator.svg?style=flat-square)](https://scrutinizer-ci.com/g/BR0kEN-/reflection-validator)\n[![Total Downloads](https://img.shields.io/packagist/dt/reflection/validator.svg?style=flat-square)](https://packagist.org/packages/reflection/validator)\n[![Latest Stable Version](https://poser.pugx.org/reflection/validator/v/stable?format=flat-square)](https://packagist.org/packages/reflection/validator)\n[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://packagist.org/packages/reflection/validator)\n\n## When might it be useful?\n\nSometimes you may want to have an unlimited sequence of methods, which cannot be restricted/controlled by the interface. In this case on a \"compilation\" stage, you can restrict those methods to follow the standards you expect.\n\nA real example from Drupal/Symfony world: http://cgit.drupalcode.org/form_alter_service/tree/src/FormAlterCompilerPass.php\n\n## Examples\n\nBesides of [fully-operable examples](examples), you can check a quick use case:\n\n```php\n(new MethodValidator(object\u003cReflectionMethod\u003e, string\u003cFQCN\u003e))\n    -\u003eaddArgument(\n        (new ArgumentSpecification('form'))\n            -\u003esetType('array')\n            -\u003esetOptional(false)\n            -\u003esetPassedByReference(true)\n    )\n    -\u003eaddArgument(\n        (new ArgumentSpecification('formState'))\n            -\u003esetType(Iterator::class)\n            -\u003esetOptional(false)\n            -\u003esetPassedByReference(false)\n    );\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbr0ken-%2Freflection-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbr0ken-%2Freflection-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbr0ken-%2Freflection-validator/lists"}