{"id":20177859,"url":"https://github.com/influxow/php-oop-project-lvl1","last_synced_at":"2025-10-05T15:27:56.209Z","repository":{"id":105046884,"uuid":"360502798","full_name":"InfluxOW/php-oop-project-lvl1","owner":"InfluxOW","description":"Validator","archived":false,"fork":false,"pushed_at":"2021-10-20T14:39:12.000Z","size":138,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-26T12:02:32.800Z","etag":null,"topics":["data-validator","hexlet","oop","php","php81","validator"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/InfluxOW.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-04-22T11:58:36.000Z","updated_at":"2021-10-20T14:39:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"1c34bea2-c9cd-4241-8c34-4b31d053f290","html_url":"https://github.com/InfluxOW/php-oop-project-lvl1","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/InfluxOW/php-oop-project-lvl1","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InfluxOW%2Fphp-oop-project-lvl1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InfluxOW%2Fphp-oop-project-lvl1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InfluxOW%2Fphp-oop-project-lvl1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InfluxOW%2Fphp-oop-project-lvl1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InfluxOW","download_url":"https://codeload.github.com/InfluxOW/php-oop-project-lvl1/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InfluxOW%2Fphp-oop-project-lvl1/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262063448,"owners_count":23252761,"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":["data-validator","hexlet","oop","php","php81","validator"],"created_at":"2024-11-14T02:17:47.624Z","updated_at":"2025-10-05T15:27:56.140Z","avatar_url":"https://github.com/InfluxOW.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Hexlet tests and linter status\n[![Actions Status](https://github.com/InfluxOW/php-oop-project-lvl1/workflows/hexlet-check/badge.svg)](https://github.com/InfluxOW/php-oop-project-lvl1/actions)\n[![Maintainability](https://api.codeclimate.com/v1/badges/5d9414318e4493b2c958/maintainability)](https://codeclimate.com/github/InfluxOW/php-oop-project-lvl1/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/5d9414318e4493b2c958/test_coverage)](https://codeclimate.com/github/InfluxOW/php-oop-project-lvl1/test_coverage)\n\n### Requirements\n\n* PHP \u003e= 8.0\n* Composer\n\n### Usage\n\n```php\n\u003c?php\n\nuse Hexlet\\Validator\\Validator;\n\n$v = new \\Hexlet\\Validator\\Validator();\n\n// strings\n$schema = $v-\u003erequired()-\u003estring();\n\n$schema-\u003eisValid('what does the fox say'); // true\n$schema-\u003eisValid(''); // false\n\n// numbers\n$schema = $v-\u003erequired()-\u003enumber()-\u003epositive();\n\n$schema-\u003eisValid(-10); // false\n$schema-\u003eisValid(10); // true\n\n// array shape\n$schema = $v-\u003earray()-\u003esizeof(2)-\u003eshape([\n    'name' =\u003e $v-\u003estring()-\u003erequired(),\n    'age' =\u003e $v-\u003enumber()-\u003epositive(),\n]);\n\n$schema-\u003eisValid(['name' =\u003e 'kolya', 'age' =\u003e 100]); // true\n$schema-\u003eisValid(['name' =\u003e '', 'age' =\u003e null]); // false\n\n// custom validation rules for existing validators\n$fn = fn($value, $start) =\u003e str_starts_with($value, $start);\n$v-\u003eaddValidator('string', 'startWith', $fn);\n\n$schema = $v-\u003estring()-\u003etest('startWith', 'H');\n\n$schema-\u003eisValid('exlet'); // false\n$schema-\u003eisValid('Hexlet'); // true\n\n// custom validators\n$fn = fn($value, $start) =\u003e str_starts_with((string) $value, (string) $start);\n$v-\u003eaddValidator('customValidator', 'startWith', $fn);\n\n$schema = $v-\u003ecustomValidator()-\u003etest('startWith', 5);\n\n$schema-\u003eisValid(13); // false\n$schema-\u003eisValid('test'); // false\n$schema-\u003eisValid(55); // true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfluxow%2Fphp-oop-project-lvl1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfluxow%2Fphp-oop-project-lvl1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfluxow%2Fphp-oop-project-lvl1/lists"}