{"id":13669366,"url":"https://github.com/Maslosoft/Addendum","last_synced_at":"2025-04-27T02:31:07.917Z","repository":{"id":6017761,"uuid":"7241292","full_name":"Maslosoft/Addendum","owner":"Maslosoft","description":"Powerfull and easy to use annotations with lightweight container","archived":false,"fork":false,"pushed_at":"2025-01-01T21:09:47.000Z","size":1269,"stargazers_count":7,"open_issues_count":5,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-07T00:48:03.855Z","etag":null,"topics":["annotations","annotations-processor","container","extra","introspection","meta","metadata","php"],"latest_commit_sha":null,"homepage":"https://maslosoft.com/addendum/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Maslosoft.png","metadata":{"files":{"readme":"README.mkd","changelog":"CHANGELOG.mkd","contributing":null,"funding":null,"license":"LICENSE-PROPRIETARY.mkd","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2012-12-19T13:56:17.000Z","updated_at":"2025-01-01T21:24:57.000Z","dependencies_parsed_at":"2023-11-22T16:13:56.856Z","dependency_job_id":null,"html_url":"https://github.com/Maslosoft/Addendum","commit_stats":{"total_commits":515,"total_committers":3,"mean_commits":"171.66666666666666","dds":"0.27184466019417475","last_synced_commit":"533ec1db4459104d9ee317c03f811345c2d5c6e1"},"previous_names":[],"tags_count":85,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maslosoft%2FAddendum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maslosoft%2FAddendum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maslosoft%2FAddendum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maslosoft%2FAddendum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Maslosoft","download_url":"https://codeload.github.com/Maslosoft/Addendum/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251080010,"owners_count":21533037,"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":["annotations","annotations-processor","container","extra","introspection","meta","metadata","php"],"created_at":"2024-08-02T08:01:11.147Z","updated_at":"2025-04-27T02:31:07.576Z","avatar_url":"https://github.com/Maslosoft.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"\u003c!--header--\u003e\n\u003c!-- Auto generated do not modify between `header` and `/header` --\u003e\n\n# \u003ca href=\"https://maslosoft.com/addendum/\"\u003e\u003cimg src=\"https://maslosoft.com/addendum/addendum.svg\" style=\"height:24px;\" alt=\"Addendum Logo\"\u003e\u003c/a\u003e \u003ca href=\"https://maslosoft.com/addendum/\"\u003eMaslosoft Addendum\u003c/a\u003e\n\u003ca href=\"https://maslosoft.com/addendum/\"\u003e_Powerful and easy to use PHP annotations_\u003c/a\u003e\n\n\u003ca href=\"https://packagist.org/packages/maslosoft/addendum\" title=\"Latest Stable Version\"\u003e\n\u003cimg src=\"https://poser.pugx.org/maslosoft/addendum/v/stable.svg\" alt=\"Latest Stable Version\" style=\"height: 20px;\"/\u003e\n\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/maslosoft/addendum\" title=\"License\"\u003e\n\u003cimg src=\"https://poser.pugx.org/maslosoft/addendum/license.svg\" alt=\"License\" style=\"height: 20px;\"/\u003e\n\u003c/a\u003e\n\u003ca href=\"https://scrutinizer-ci.com/g/Maslosoft/Addendum/?branch=master\"\u003e\n\t\u003cimg src=\"https://scrutinizer-ci.com/g/Maslosoft/Addendum/badges/quality-score.png?b=master\" alt=\"Scrutinizer Code Quality\"/\u003e\n\u003c/a\u003e\n\u003ca href=\"https://scrutinizer-ci.com/g/Maslosoft/Addendum/?branch=master\"\u003e\n\t\u003cimg src=\"https://scrutinizer-ci.com/g/Maslosoft/Addendum/badges/coverage.png?b=master\" alt=\"Code Coverage\" /\u003e\n\u003c/a\u003e\n\n### Quick Install\n```bash\ncomposer require maslosoft/addendum\n```\n\n### Documentation\n\n\u003ca href=\"https://maslosoft.com/addendum/docs/\"\u003eFull Addendum Documentation\u003c/a\u003e\n\n\n\n\n\n# Annotations for PHP\n\nThis project provides smart annotations support for PHP\nlanguage with the aim on performance and ease of use.\n\nAnnotations are in fact a kind declarative language embedded\nin PHP code. It does not allow and flow control structures, loops,\nconditions. It allows us to describe what is required or what\nwe expect from parf of code.\n\n## Where to use annotations\n\nWhile (PHP) programming language itself is very flexible and allows\nus to describe complex bahaviors, there are some aspects where\nwe want to only describe (or configure) such behaviors. And we\nwant to keep our *main* code as is, while adding some additional\nbehaviors, which might include:\n\n* Access control\n* Way to display data\n* Whether to store data\n* Where to store data\n* Should the data be searchable\n\nAnd so on, with ever growing list of aspects and behaviors. While this\ncould be made by implementing in our classe more and more interfaces,\nsoon those would end up in hundreds of methods.\n\nAnother way could be some kind of extra meta-data configuration,\nlet it be in XML, JSON or YAML files. This requires us to keep\nthose too files in sync and also separates declarations from\ncode. But we might need extra behaviors/aspects for many libraries - \nresulting in code being split into two or more files.\n\n### Embed behavior into code\n\nSo the idea is to embed those extra aspects of class into code. With\nannotations - special comment tags placed just above class/method/property\ndeclaration.\n\nThese annotations can be interpreted independently by different parts\nof program. These are extensible, so that adding more annotations\ndoes not influence existing code.\n\nDifferent application parts might interpret just part of annotations\nwhile ignoring unknown ones.\n\nIn below example one part will react `@Label` and `@Description` declarations,\nother will perform some extra operations when will encouner `@I18N` annotation.\n\nExample:\n\n```php\nclass Page implements AnnotatedInterface\n{\n\t/**\n\t * Page URL\n\t * @Label('Page URL')\n\t * @Description('Relative URL, it should be simple lowercase string with words separated by hyphen')\n\t * @SearchBoost(3.5)\n\t * @I18N\n\t * @SafeValidator\n\t * @UrlValidator\n\t * @Decorator(Action, 'update')\n\t * @see Action\n\t * @var string\n\t */\n\tpublic $url = '';\n}\n\n```\n\nAll extra metadata is contained just where class property is declared. This is it. \nAnnotations itself are *not* evaluated on each request. These are used to generate\nmetadata, which is later available by using meta containers. Having any object\nimplementing `AnnotatedInterface`, metadata can be obtained by passing either \nobject or class name.\n\nExample of getting meta data:\n```php\necho Meta::create(Page::class)-\u003eurl-\u003elabel;\n// Will echo \"Page URL\"\n```\n\nThis metadata is cached, so there is no overhead of parsing annotations.\n\n\u003c!--/header--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMaslosoft%2FAddendum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMaslosoft%2FAddendum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMaslosoft%2FAddendum/lists"}