{"id":14983771,"url":"https://github.com/symfony/type-info","last_synced_at":"2026-03-06T19:13:06.970Z","repository":{"id":220788948,"uuid":"752589828","full_name":"symfony/type-info","owner":"symfony","description":"Extracts PHP types information.","archived":false,"fork":false,"pushed_at":"2026-03-04T13:55:48.000Z","size":285,"stargazers_count":197,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"8.1","last_synced_at":"2026-03-04T14:24:33.789Z","etag":null,"topics":["component","php","phpdoc","phpstan","symfony","symfony-component","type"],"latest_commit_sha":null,"homepage":"https://symfony.com/type-info","language":"PHP","has_issues":false,"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/symfony.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["fabpot","nicolas-grekas"],"custom":"https://symfony.com/sponsor","tidelift":"packagist/symfony/symfony"}},"created_at":"2024-02-04T09:44:18.000Z","updated_at":"2026-03-04T08:21:43.000Z","dependencies_parsed_at":"2024-03-30T08:40:26.868Z","dependency_job_id":"a94849e0-b9fe-450f-b150-65d92935b772","html_url":"https://github.com/symfony/type-info","commit_stats":{"total_commits":17,"total_committers":10,"mean_commits":1.7,"dds":0.7058823529411764,"last_synced_commit":"a13032128c307470955c45c99201349b15cd7f4a"},"previous_names":["symfony/type-info"],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/symfony/type-info","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symfony%2Ftype-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symfony%2Ftype-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symfony%2Ftype-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symfony%2Ftype-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/symfony","download_url":"https://codeload.github.com/symfony/type-info/tar.gz/refs/heads/8.1","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symfony%2Ftype-info/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30192631,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["component","php","phpdoc","phpstan","symfony","symfony-component","type"],"created_at":"2024-09-24T14:07:54.016Z","updated_at":"2026-03-06T19:13:06.962Z","avatar_url":"https://github.com/symfony.png","language":"PHP","readme":"TypeInfo Component\n==================\n\nThe TypeInfo component extracts PHP types information.\n\nGetting Started\n---------------\n\n```bash\ncomposer require symfony/type-info\ncomposer require phpstan/phpdoc-parser # to support raw string resolving\n```\n\n```php\n\u003c?php\n\nuse Symfony\\Component\\TypeInfo\\Type;\nuse Symfony\\Component\\TypeInfo\\TypeIdentifier;\nuse Symfony\\Component\\TypeInfo\\TypeResolver\\TypeResolver;\n\n// Instantiate a new resolver\n$typeResolver = TypeResolver::create();\n\n// Then resolve types for any subject\n$typeResolver-\u003eresolve(new \\ReflectionProperty(Dummy::class, 'id')); // returns an \"int\" Type instance\n$typeResolver-\u003eresolve('bool'); // returns a \"bool\" Type instance\n\n// Types can be instantiated thanks to static factories\n$type = Type::list(Type::nullable(Type::bool()));\n\n// Type classes have their specific methods\nType::object(FooClass::class)-\u003egetClassName();\nType::enum(FooEnum::class, Type::int())-\u003egetBackingType();\nType::list(Type::int())-\u003eisList();\n\n// Every type can be cast to string\n(string) Type::generic(Type::object(Collection::class), Type::int()) // returns \"Collection\u003cint\u003e\"\n\n// You can check that a type (or one of its wrapped/composed parts) is identified by one of some identifiers.\n$type-\u003eisIdentifiedBy(Foo::class, Bar::class);\n$type-\u003eisIdentifiedBy(TypeIdentifier::OBJECT);\n$type-\u003eisIdentifiedBy('float');\n\n// You can also check that a type satisfies specific conditions\n$type-\u003eisSatisfiedBy(fn (Type $type): bool =\u003e !$type-\u003eisNullable() \u0026\u0026 $type-\u003eisIdentifiedBy(TypeIdentifier::INT));\n```\n\nResources\n---------\n * [Documentation](https://symfony.com/doc/current/components/type_info.html)\n * [Contributing](https://symfony.com/doc/current/contributing/index.html)\n * [Report issues](https://github.com/symfony/symfony/issues) and\n   [send Pull Requests](https://github.com/symfony/symfony/pulls)\n   in the [main Symfony repository](https://github.com/symfony/symfony)\n","funding_links":["https://github.com/sponsors/fabpot","https://github.com/sponsors/nicolas-grekas","https://symfony.com/sponsor","https://tidelift.com/funding/github/packagist/symfony/symfony"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsymfony%2Ftype-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsymfony%2Ftype-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsymfony%2Ftype-info/lists"}