{"id":20089919,"url":"https://github.com/bugadani/validatiny","last_synced_at":"2026-05-12T14:37:14.268Z","repository":{"id":62497987,"uuid":"42532983","full_name":"bugadani/Validatiny","owner":"bugadani","description":"A simple PHP object validator library","archived":false,"fork":false,"pushed_at":"2016-05-06T08:45:23.000Z","size":40,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-13T02:43:17.517Z","etag":null,"topics":[],"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/bugadani.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":"2015-09-15T16:49:28.000Z","updated_at":"2016-05-06T08:45:24.000Z","dependencies_parsed_at":"2022-11-02T11:45:57.481Z","dependency_job_id":null,"html_url":"https://github.com/bugadani/Validatiny","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugadani%2FValidatiny","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugadani%2FValidatiny/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugadani%2FValidatiny/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugadani%2FValidatiny/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bugadani","download_url":"https://codeload.github.com/bugadani/Validatiny/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241525427,"owners_count":19976709,"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":[],"created_at":"2024-11-13T16:20:45.249Z","updated_at":"2026-05-12T14:37:14.217Z","avatar_url":"https://github.com/bugadani.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/bugadani/Validatiny.svg?branch=master)](https://travis-ci.org/bugadani/Validatiny)\n\nValidatiny\n========\nValidatiny is a simple PHP library used to validate objects against a set of rules.\n\nValidatiny is licensed under the MIT license.\n\nRules\n========\nValidatiny uses subclasses of Validatiny\\Rule to validate objects. The current subclasses are:\n * All - validates against a list of Rules where all Rules must apply\n * Boolean - accepts only true or false\n * Callable - accepts callable values\n * Callback - calls a function or static method to validate the value.\n * CollectionOf - validates a collection of elements against a single rule (e.g. validates is something is an array of numbers)\n * Enum - validates against a list of values\n * Not - negates the result of the inner validator\n * Number - validates a numeric value with optional range parameters\n * Object - checks the object type and optionally validates the object as well\n * Optional - accepts null or validates using an inner rule\n * Pattern - validates a regexp pattern\n * String - validates a string with optional length parameters\n * Structure - validates that the given object or array has the given fields. This rule has a 'strict' option that requires the validated array or object to only have the specified fields.\n * Union - validates against a list of Rules where at least one of the Rules must apply, useful for collections or optional rules\n * more to come...\n\nValidatiny can apply the Rules on public properties and getter methods. Any number of Rules may be set and all of them\n must be valid in order for the property and/or method to be considered valid. An object is considered valid if all of\n its properties and methods are valid.\n\nThe following Rules can also be applied to objects, as well:\n * All\n * Callback\n * Not\n * Optional\n * Union\n\nNote: generic validation rules can be applied as PHP code using the Callback Rule on the validated class.\n\nValidation scenarios\n========\nRules can be added to specific validation scenarios. This enables the user to specify multiple sets of rules on\na single object.\n\nTo specify which rule should belong to which scenario, use the `scenario: 'scenarioName'` attribute on the rule\nannotation, or call `$rule-\u003esetScenario()`. Both of these accept a single name or an array of scenario names.\n\nBy default, Validatiny validates all rules on an object. To override this behaviour, pass the name of the validation\nscenario as the second parameter for `Validator::validate`.\n\nTo be continued...","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugadani%2Fvalidatiny","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbugadani%2Fvalidatiny","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugadani%2Fvalidatiny/lists"}