{"id":30714843,"url":"https://github.com/attributes-php/options","last_synced_at":"2026-01-20T17:34:03.411Z","repository":{"id":299371919,"uuid":"1001575681","full_name":"Attributes-PHP/options","owner":"Attributes-PHP","description":"A collection of Attributes to enhance the validation/serialization stages","archived":false,"fork":false,"pushed_at":"2025-06-24T07:45:50.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-02T10:58:29.230Z","etag":null,"topics":["enhance","serialization","validation"],"latest_commit_sha":null,"homepage":"","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/Attributes-PHP.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-13T16:07:14.000Z","updated_at":"2025-06-24T07:45:15.000Z","dependencies_parsed_at":"2025-06-16T08:04:35.543Z","dependency_job_id":"6c310a71-464d-4a5b-9c81-74bb16c6c373","html_url":"https://github.com/Attributes-PHP/options","commit_stats":null,"previous_names":["attributes-php/options"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Attributes-PHP/options","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Attributes-PHP%2Foptions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Attributes-PHP%2Foptions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Attributes-PHP%2Foptions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Attributes-PHP%2Foptions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Attributes-PHP","download_url":"https://codeload.github.com/Attributes-PHP/options/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Attributes-PHP%2Foptions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273397842,"owners_count":25098235,"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-09-03T02:00:09.631Z","response_time":76,"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":["enhance","serialization","validation"],"created_at":"2025-09-03T05:47:24.927Z","updated_at":"2026-01-20T17:34:03.398Z","avatar_url":"https://github.com/Attributes-PHP.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Attributes Options\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://codecov.io/gh/Attributes-PHP/options\"\u003e\u003cimg src=\"https://codecov.io/gh/Attributes-PHP/options/graph/badge.svg?token=J2kqNp5cho\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/Attributes-PHP/options\"\u003e\u003cimg alt=\"Latest Version\" src=\"https://img.shields.io/packagist/v/Attributes-PHP/options\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/Attributes-PHP/options\"\u003e\u003cimg alt=\"Software License\" src=\"https://img.shields.io/badge/Licence-MIT-brightgreen\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n**Attributes Options** is a collection of Attributes that can be used to enhance the [validation](https://github.com/Attributes-PHP/validation)\nand/or [serialization](https://github.com/Attributes-PHP/serializer) stages.\n\n## Supported options\n\n### Class specific options\n\n- *AliasGenerator*, generates an alias per each class property\n\n### Property options\n\n- *Alias*, specifies a given alias for a property\n- *Ignore*, skips the validation and/or serialization of a property\n\n## Requirements\n\n- PHP 8.1+\n\nWe aim to support versions that haven't reached their end-of-life.\n\n## How it works?\n\n```php\n\u003c?php\n\nuse Attributes\\Validation\\Validator;\nuse Attributes\\Options\\AliasGenerator;\nuse Attributes\\Options\\Alias;\nuse Attributes\\Options\\Ignore;\nuse Attributes\\Serialization\\Serializer;\n\n#[AliasGenerator('snake')]\nclass Login\n{\n    public string $userName;\n\n    #[Alias('password'), Ignore(validation: false)]\n    public string $myPassword;\n}\n\n$rawData = [\n    'user_name' =\u003e 'user',\n    'password'  =\u003e '1234',\n];\n\n// Validation stage\n$validator = new Validator();\n$login = $validator-\u003evalidate($rawData, new Login);\n\nvar_dump($login-\u003euser);     // string(4) \"user\nvar_dump($login-\u003epassword); // string(4) \"1234\"\n\n// Serialization stage\n$serializer = new Serializer;\n$serializedData = $serializer-\u003eserialize($login);\n\nvar_dump($serializedData);          // array { [\"user_name\"] =\u003e \"user\" }\n```\n\n## Installation\n\n```bash\ncomposer require attributes-php/options\n```\n\nAttributes Options was created by **[André Gil](https://www.linkedin.com/in/andre-gil/)** and is open-sourced software licensed under the **[MIT license](https://opensource.org/licenses/MIT)**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fattributes-php%2Foptions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fattributes-php%2Foptions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fattributes-php%2Foptions/lists"}