{"id":18864316,"url":"https://github.com/devtronic/php-annotation-lexer","last_synced_at":"2026-02-11T08:30:15.590Z","repository":{"id":56967198,"uuid":"62334225","full_name":"devtronic/php-annotation-lexer","owner":"devtronic","description":null,"archived":false,"fork":false,"pushed_at":"2016-07-01T04:48:05.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-30T21:29:12.561Z","etag":null,"topics":[],"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/devtronic.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-06-30T18:38:32.000Z","updated_at":"2016-07-01T04:47:47.000Z","dependencies_parsed_at":"2022-08-21T09:50:44.592Z","dependency_job_id":null,"html_url":"https://github.com/devtronic/php-annotation-lexer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtronic%2Fphp-annotation-lexer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtronic%2Fphp-annotation-lexer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtronic%2Fphp-annotation-lexer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtronic%2Fphp-annotation-lexer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devtronic","download_url":"https://codeload.github.com/devtronic/php-annotation-lexer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239808525,"owners_count":19700451,"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":[],"created_at":"2024-11-08T04:40:51.041Z","updated_at":"2026-02-11T08:30:15.521Z","avatar_url":"https://github.com/devtronic.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Annotation Lexer\n\nPHP Annotation Lexer can extract the annotations (a.k.a. PHP Doc) from you sour cecode\n\n### Example\n```php\n\u003c?php\n\nuse Devtronic\\PHPAnnotationLexer\\PHPAnnotationLexer;\n\nrequire 'vendor/autoload.php';\n\n// Simple annotation block\n$data = \u003c\u003c\u003cPHP\n    /**\n     * @ANNOTATION\\DESC FooBar\n     * @ANNOTATION\\PARAMETERS {\n     *      baz(type=\"string\", required=\"true\")\n     * }\n     * @return array The Parsed Attributes\n     */\nPHP;\n\n// Initialize the lexer\n$lexer = new PHPAnnotationLexer();\n\n// Lex the block from above\n$res = $lexer-\u003elexFromString($data);\nprint_r($res);\n\n// Lex a file\n$res = $lexer-\u003elexFromFile('./vendor/devtronic/php-annotation-lexer/PHPAnnotationLexer.php');\nprint_r($res);\n```\n\n#### Output\n```\nArray\n(\n    [0] =\u003e Array\n        (\n            [@ANNOTATION\\DESC] =\u003e FooBar\n            [@ANNOTATION\\PARAMETERS] =\u003e Array\n                (\n                    [0] =\u003e Array\n                        (\n                            [@name] =\u003e baz\n                            [@attr] =\u003e Array\n                                (\n                                    [type] =\u003e string\n                                    [required] =\u003e true\n                                )\n\n                        )\n\n                )\n\n            [@return] =\u003e array The Parsed Attributes\n        )\n)\n\n\n\nArray\n(\n    [0] =\u003e Array\n        (\n            [Class] =\u003e PHPAnnotationLexer\n            [@package] =\u003e Devtronic\\PHPAnnotationLexer\n        )\n\n    [1] =\u003e Array\n        (\n            [@var] =\u003e string PHP Source Code To Lex\n        )\n\n    [2] =\u003e Array\n        (\n            [@param] =\u003e string $sourceFile The Path To The Source File\n            [@return] =\u003e array|bool If The File Exists The Lexed Source, Otherwise False\n        )\n\n    [3] =\u003e Array\n        (\n            [@param] =\u003e string $source PHP Source To Lex\n            [@return] =\u003e array The Lexed Source\n        )\n\n    [4] =\u003e Array\n        (\n            [@Foo\\Bar)] =\u003e Array\n                (\n                    [0] =\u003e Array\n                        (\n                            [@name] =\u003e And The Content\n                            [@attr] =\u003e Array\n                                (\n                                )\n\n                        )\n\n                    [1] =\u003e  And Put It Together\n                )\n\n            [@return] =\u003e array The Result Of Stage One\n        )\n\n    [5] =\u003e Array\n        (\n            [@param] =\u003e array $result The Result From Stage One\n            [@return] =\u003e array The Result Of Stage Two\n        )\n\n    [6] =\u003e Array\n        (\n            [@param] =\u003e string $str The Content From Stage One\n            [@return] =\u003e array|mixed The Parsed Content\n        )\n\n    [7] =\u003e Array\n        (\n            [@param] =\u003e string $attr_str The Un-Parsed Attribute String\n            [@return] =\u003e array The Parsed Attributes\n        )\n\n)\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevtronic%2Fphp-annotation-lexer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevtronic%2Fphp-annotation-lexer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevtronic%2Fphp-annotation-lexer/lists"}