{"id":25687201,"url":"https://github.com/holyshared/attribute","last_synced_at":"2026-03-05T14:31:53.476Z","repository":{"id":56985448,"uuid":"43593719","full_name":"holyshared/attribute","owner":"holyshared","description":"Attribute for Hack","archived":false,"fork":false,"pushed_at":"2015-10-03T15:58:33.000Z","size":160,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-07T01:58:17.407Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Hack","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/holyshared.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}},"created_at":"2015-10-03T09:10:09.000Z","updated_at":"2015-10-03T09:26:41.000Z","dependencies_parsed_at":"2022-08-21T12:20:29.170Z","dependency_job_id":null,"html_url":"https://github.com/holyshared/attribute","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/holyshared/attribute","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holyshared%2Fattribute","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holyshared%2Fattribute/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holyshared%2Fattribute/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holyshared%2Fattribute/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/holyshared","download_url":"https://codeload.github.com/holyshared/attribute/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holyshared%2Fattribute/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30130388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T12:40:50.676Z","status":"ssl_error","status_checked_at":"2026-03-05T12:39:32.209Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2025-02-24T20:08:21.517Z","updated_at":"2026-03-05T14:31:53.451Z","avatar_url":"https://github.com/holyshared.png","language":"Hack","funding_links":[],"categories":[],"sub_categories":[],"readme":"attribute\n====================\n\nAttribute for Hack\n\n[![Latest Stable Version](https://poser.pugx.org/holyshared/attribute/v/stable)](https://packagist.org/packages/holyshared/attribute)\n[![Build Status](https://travis-ci.org/holyshared/attribute.svg?branch=master)](https://travis-ci.org/holyshared/attribute)\n[![Dependency Status](https://www.versioneye.com/user/projects/560ff3b5a193340015000001/badge.svg?style=flat)](https://www.versioneye.com/user/projects/560ff3b5a193340015000001)\n[![License](https://poser.pugx.org/holyshared/attribute/license)](https://packagist.org/packages/holyshared/attribute)\n\nClassAttribute\n--------------------\n\n```hack\n\u003c?hh //strict\n\nnamespace example;\n\nuse attribute\\ClassAttribute;\n\nfinal class Tag extends ClassAttribute\n{\n\n    public function __construct(\n        private string $name\n    )\n    {\n    }\n\n    public function value() : string\n    {\n        return $this-\u003ename;\n    }\n\n}\n```\n\n```hack\n\u003c?hh //strict\n\nnamespace example;\n\n\u003c\u003cTag('important')\u003e\u003e\nclass TaggedTarget\n{\n}\n\n```\n\n```hack\n\u003c?hh //strict\n\nnamespace example;\n\n$attribute = Tag::findByClassName(TaggedTarget::class);\nvar_dump($attribute-\u003evalue()); // Tag attribute instance\n\n$attribute = Tag::findByClass(new ReflectionClass(TaggedTarget::class));\nvar_dump($attribute-\u003evalue()); // Tag attribute instance\n```\n\nMethodAttribute\n--------------------\n\n```hack\n\u003c?hh //strict\n\nnamespace example;\n\nuse attribute\\MethodAttribute;\n\nfinal class Tag extends MethodAttribute\n{\n\n    public function __construct(\n        private string $name\n    )\n    {\n    }\n\n    public function value() : string\n    {\n        return $this-\u003ename;\n    }\n\n}\n```\n\n```hack\n\u003c?hh //strict\n\nnamespace example;\n\nclass TaggedTarget\n{\n\n    public function __construct(\n        private string $name\n    )\n    {\n    }\n\n    \u003c\u003cTag('important')\u003e\u003e\n    public function getName() : string\n    {\n        return $this-\u003ename;\n    }\n\n}\n```\n\n\n```hack\n\u003c?hh //strict\n\nnamespace example;\n\n$attributes = Tag::findByClassName(TaggedTarget::class);\nvar_dump($attributes-\u003eat('getName')-\u003evalue()); // important\n\n$attributes = Tag::findByClass(new ReflectionClass(TaggedTarget::class));\nvar_dump($attributes-\u003eat('getName')-\u003evalue()); // important\n\n$attribute = Tag::findByMethod(new ReflectionMethod(TaggedTarget::class, 'getName'));\nvar_dump($attribute-\u003evalue()); // important\n```\n\n\nRun the test\n--------------------\n\n\tcomposer install\n\tcomposer test\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholyshared%2Fattribute","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fholyshared%2Fattribute","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholyshared%2Fattribute/lists"}