{"id":18323631,"url":"https://github.com/mortalflesh/typevalidator","last_synced_at":"2025-08-30T17:45:52.085Z","repository":{"id":45001197,"uuid":"67360597","full_name":"MortalFlesh/TypeValidator","owner":"MortalFlesh","description":"TypeValidator for asserting types of values","archived":false,"fork":false,"pushed_at":"2022-01-14T13:44:43.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-07T22:12:25.707Z","etag":null,"topics":["asserting-types","generic-types","generics","typevalidator"],"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/MortalFlesh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-09-04T18:08:18.000Z","updated_at":"2022-01-14T13:43:58.000Z","dependencies_parsed_at":"2022-09-06T02:01:54.029Z","dependency_job_id":null,"html_url":"https://github.com/MortalFlesh/TypeValidator","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/MortalFlesh/TypeValidator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MortalFlesh%2FTypeValidator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MortalFlesh%2FTypeValidator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MortalFlesh%2FTypeValidator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MortalFlesh%2FTypeValidator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MortalFlesh","download_url":"https://codeload.github.com/MortalFlesh/TypeValidator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MortalFlesh%2FTypeValidator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272884345,"owners_count":25009599,"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-08-30T02:00:09.474Z","response_time":77,"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":["asserting-types","generic-types","generics","typevalidator"],"created_at":"2024-11-05T18:28:56.331Z","updated_at":"2025-08-30T17:45:52.023Z","avatar_url":"https://github.com/MortalFlesh.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"TypeValidator\n=============\n\n[![Latest Stable Version](https://img.shields.io/packagist/v/mf/type-validator.svg)](https://packagist.org/packages/mf/type-validator)\n[![Tests and linting](https://github.com/MortalFlesh/TypeValidator/actions/workflows/tests.yaml/badge.svg)](https://github.com/MortalFlesh/TypeValidator/actions/workflows/tests.yaml)\n[![Coverage Status](https://coveralls.io/repos/github/MortalFlesh/TypeValidator/badge.svg?branch=master)](https://coveralls.io/github/MortalFlesh/TypeValidator?branch=master)\n[![Total Downloads](https://img.shields.io/packagist/dt/mf/type-validator.svg)](https://packagist.org/packages/mf/type-validator)\n[![License](https://img.shields.io/packagist/l/mf/type-validator.svg)](https://packagist.org/packages/mf/type-validator)\n\nTypeValidator for asserting types of values\n\n## Table of Contents\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n\n## \u003ca name=\"requirements\"\u003e\u003c/a\u003eRequirements\n- PHP 8.0\n\n\n## \u003ca name=\"installation\"\u003e\u003c/a\u003eInstallation:\n```\ncomposer require mf/type-validator\n```\n\n\n## \u003ca name=\"usage\"\u003e\u003c/a\u003eUsage\n```php\n$validator = new TypeValidator(\n    TypeValidator::TYPE_STRING,\n    TypeValidator::TYPE_INT,\n    [TypeValidator::TYPE_STRING],\n    [TypeValidator::INT]\n);\n\n$validator-\u003eassertKeyType('string - value');\n$validator-\u003eassertValueType(1);\n\n$validator-\u003eassertValueType('invalid value type');  // throws InvalidArgumentException\n```\n\n### With Custom Exception\n```php\n$validator = new TypeValidator(\n    TypeValidator::TYPE_STRING,\n    TypeValidator::TYPE_INT,\n    [TypeValidator::TYPE_STRING],\n    [TypeValidator::INT],\n    App\\MyCustomException::class\n);\n\n$validator-\u003eassertKeyType('string - value');\n$validator-\u003eassertValueType(1);\n\n$validator-\u003eassertValueType('invalid value type');  // throws App\\MyCustomException\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmortalflesh%2Ftypevalidator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmortalflesh%2Ftypevalidator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmortalflesh%2Ftypevalidator/lists"}