{"id":15296420,"url":"https://github.com/koriym/koriym.paramreader","last_synced_at":"2025-04-13T19:41:50.603Z","repository":{"id":57008574,"uuid":"467068672","full_name":"koriym/Koriym.ParamReader","owner":"koriym","description":"An attribute/annotation reader for parameters","archived":false,"fork":false,"pushed_at":"2024-05-13T18:18:43.000Z","size":76,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T10:21:23.215Z","etag":null,"topics":["annotation","attribute","php8"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/koriym/param-reader","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/koriym.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-07T11:39:21.000Z","updated_at":"2024-05-13T18:14:17.000Z","dependencies_parsed_at":"2024-09-30T18:10:29.642Z","dependency_job_id":null,"html_url":"https://github.com/koriym/Koriym.ParamReader","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"ac434dd03f4866bd3a4b96f7d9614b78bb4dd683"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koriym%2FKoriym.ParamReader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koriym%2FKoriym.ParamReader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koriym%2FKoriym.ParamReader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koriym%2FKoriym.ParamReader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koriym","download_url":"https://codeload.github.com/koriym/Koriym.ParamReader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248770763,"owners_count":21159031,"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":["annotation","attribute","php8"],"created_at":"2024-09-30T18:10:25.680Z","updated_at":"2025-04-13T19:41:50.582Z","avatar_url":"https://github.com/koriym.png","language":"PHP","readme":"# Koriym.ParamReader\n\nThis is a meta data reader to get attributes or annotations from method parameters.\n\nAlthough [doctine/annotation](https://github.com/doctrine/annotations) cannot annotate method parameters, this reader treats annotations of properties with the same names as method parameters as method parameter metadata.\n\nThis is especially useful when you want to prepare metadata for injection.\n\n## Installation\n\n    composer require koriym/param-reader\n\n## Getting Started\n\n```php\n$reader = new PramReader();\n$user = $reader-\u003egetParametrAnnotation(new ReflectionParameter([Consumer::class, '__construct'], 'name'), User::class);\nassert($user instanceof User);\n\n$users = $reader-\u003egetParametrAnnotations(new ReflectionParameter([Consumer::class, '__construct'], 'name'));\nassert($users[0] instanceof User);\nassert($users[1] instanceof Foo);\n````\n\nThe following two codes provide the same meta information.\n\n```php\nclass Consumer\n{\n    private $name;\n    \n    public function __construct(#[User, Foo] string $name) {\n        $this-\u003ename = $name;\n    }\n}\n```\n\n```php\nclass Consumer\n{\n    /**\n     * @User\n     * @Foo\n     */\n    private $name;\n    \n    public function __construct(string $name) {\n        $this-\u003ename = $name;\n    }\n}\n```\n\n## Related\n\n* [koriym/attributes](https://github.com/koriym/Koriym.Attributes)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoriym%2Fkoriym.paramreader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoriym%2Fkoriym.paramreader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoriym%2Fkoriym.paramreader/lists"}