{"id":16233222,"url":"https://github.com/marcw/validator","last_synced_at":"2025-03-19T14:31:26.918Z","repository":{"id":62523956,"uuid":"67589494","full_name":"marcw/validator","owner":"marcw","description":"Symfony Validators for: Subdomain validation, Username, GA Tracker ID, SMS Message, HTML Color, ","archived":false,"fork":false,"pushed_at":"2023-04-22T09:58:43.000Z","size":24,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T19:20:47.640Z","etag":null,"topics":["php","sms-messages","symfony","symfony-validator","username","validator"],"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/marcw.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}},"created_at":"2016-09-07T08:51:32.000Z","updated_at":"2023-07-26T23:39:45.000Z","dependencies_parsed_at":"2024-10-27T20:37:25.792Z","dependency_job_id":"86147f84-995d-4df7-b47d-12679f53893d","html_url":"https://github.com/marcw/validator","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcw%2Fvalidator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcw%2Fvalidator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcw%2Fvalidator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcw%2Fvalidator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcw","download_url":"https://codeload.github.com/marcw/validator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243997108,"owners_count":20380980,"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","sms-messages","symfony","symfony-validator","username","validator"],"created_at":"2024-10-10T13:11:53.239Z","updated_at":"2025-03-19T14:31:26.673Z","avatar_url":"https://github.com/marcw.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Validator\n\n[![Build Status](https://travis-ci.org/marcw/validator.svg?branch=master)](https://travis-ci.org/marcw/validator)\n[![Coverage Status](https://coveralls.io/repos/github/marcw/validator/badge.svg?branch=master)](https://coveralls.io/github/marcw/validator?branch=master)\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/75cf3a3f-a16d-4f05-a3e8-46b190b4daf5/mini.png)](https://insight.sensiolabs.com/projects/75cf3a3f-a16d-4f05-a3e8-46b190b4daf5)\n\nSome additions to the [Validator Symfony Component](github.com/symfony/symfony).\n\n## Subdomain validation\n\nValidate a string value based on these rules:\n\n- Be not null.\n- Be not blank.\n- Be more than or equal to 3 characters.\n- Be less than 63 characters.\n- Be in alphanumeric and hyphen.\n- Do not start with an hyphen.\n- Do not end with an hyphen.\n\n\n## Username validation\n\nValidate a string value based on [The Big Username\nBlocklist](https://github.com/marteinn/The-Big-Username-Blocklist). It won't\nvalidate if the value is equal to one of these terms.\n\n## GoogleAnalytics Tracker ID validation\n\nValidate that a string matches the correct format for a Google Analytics Tracker ID.\n\n## SMS Message Validation.\n\nValidate that a value fits in one (or more) SMS message.\n\n## HTMLColor validator\n\nValidate that a string matches the basic HTML format for a color (`#abc` or `#abcdef`)\n\n## Example\n\n```php\n\u003c?php\n\nnamespace AppBundle\\Entity;\n\nuse MarcW\\Validator\\Constraints as Assert;\n\nclass User\n{\n    /**\n     * The username is used to attribute a subdomain or a subfolder to the user like:\n     * https://username.acme.com or https://acme.com/username\n     * @Assert\\Subdomain\n     * @Assert\\Username\n     */\n    private $username;\n\n    /**\n     * @Assert\\GoogleAnalytics\n     */\n    private $googleAnalytics;\n\n    /**\n     * @Assert\\HTMLColor\n     */\n    private $backgroundColor;\n}\n\nclass Message\n{\n    /**\n     * This value must fit in 2 SMS messages.\n     *\n     * @Assert\\SmsMessage(max=2)\n     */\n    private $body;\n}\n```\n\nFor more information, please read the [Symfony Validator component official documentation](http://symfony.com/doc/current/components/validator.html).\n\n## Install\n\n```\ncomposer require marcw/validator\n```\n\n## Can I contribute?\n\nSure! Feel free to report issues, send pull-requests, or ask for help.\n\n## LICENSE\n\nSee the [LICENSE](/LICENSE) file.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcw%2Fvalidator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcw%2Fvalidator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcw%2Fvalidator/lists"}