{"id":18993551,"url":"https://github.com/phpowermove/docblock","last_synced_at":"2025-04-15T03:55:01.206Z","repository":{"id":17464778,"uuid":"20238868","full_name":"phpowermove/docblock","owner":"phpowermove","description":"PHP DocBlock parser and generator. An API to read and write DocBlocks.","archived":false,"fork":false,"pushed_at":"2021-09-22T17:03:26.000Z","size":289,"stargazers_count":24,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T03:54:55.990Z","etag":null,"topics":["docblock"],"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/phpowermove.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":"2014-05-27T23:30:22.000Z","updated_at":"2023-11-14T08:41:15.000Z","dependencies_parsed_at":"2022-09-01T23:21:37.956Z","dependency_job_id":null,"html_url":"https://github.com/phpowermove/docblock","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpowermove%2Fdocblock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpowermove%2Fdocblock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpowermove%2Fdocblock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpowermove%2Fdocblock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpowermove","download_url":"https://codeload.github.com/phpowermove/docblock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249003954,"owners_count":21196794,"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":["docblock"],"created_at":"2024-11-08T17:22:01.486Z","updated_at":"2025-04-15T03:55:01.189Z","avatar_url":"https://github.com/phpowermove.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docblock\n\n[![License](https://img.shields.io/github/license/phpowermove/docblock.svg?style=flat-square)](https://packagist.org/packages/phpowermove/docblock)\n[![Latest Stable Version](https://img.shields.io/packagist/v/phpowermove/docblock.svg?style=flat-square)](https://packagist.org/packages/phpowermove/docblock)\n[![Total Downloads](https://img.shields.io/packagist/dt/phpowermove/docblock.svg?style=flat-square\u0026colorB=007ec6)](https://packagist.org/packages/phpowermove/docblock)\n![Tests](https://github.com/phpowermove/docblock/workflows/Docblock%20Test%20Suite/badge.svg)\n![Coverage report](https://github.com/phpowermove/docblock/workflows/Coverage/badge.svg)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/phpowermove/docblock/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/phpowermove/docblock/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/phpowermove/docblock/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/phpowermove/docblock/?branch=master)\n\nPHP Docblock parser and generator. An API to read and write Docblocks.\n\n\u003e __WARNING__: starting from version 4.0 the library has moved to [phpowermove organization](https://github.com/phpowermove) and the namespace is `phpowermove\\docblock`.\n\n## Installation\n\nInstall via Composer:\n\n```\ncomposer require phpowermove/docblock\n```\n\n## Usage\n\n### 1. Generate a Docblock instance\n\na) Simple:\n\n```php\nuse phpowermove\\docblock\\Docblock;\n\n$docblock = new Docblock();\n```\n\nb) Create from string:\n\n```php\nuse phpowermove\\docblock\\Docblock;\n\n$docblock = new Docblock('/**\n * Short Description.\n *\n * Long Description.\n *\n * @author gossi\n */');\n```\n\nc) Create from reflection:\n\n```php\nuse phpowermove\\docblock\\Docblock;\n\n$docblock = new Docblock(new \\ReflectionClass('MyClass'));\n```\n\n### 2. Manipulate tags\n\nGet the tags:\n\n```php\n$tags = $docblock-\u003egetTags();\n```\n\nGet tags by name:\n\n```php\n$tags = $docblock-\u003egetTags('author');\n```\n\nAppend a tag:\n\n```php\nuse phpowermove\\docblock\\tags\\AuthorTag;\n\n$author = new AuthorTag();\n$author-\u003esetName('gossi');\n$docblock-\u003eappendTag($author);\n```\n\nor with fluent API:\n\n```php\nuse phpowermove\\docblock\\tags\\AuthorTag;\n\n$docblock-\u003eappendTag(AuthorTag::create()\n\t-\u003esetName('gossi')\n);\n```\n\nCheck tag existence:\n\n```php\n$docblock-\u003ehasTag('author');\n```\n\n### 3. Get back the string\n\nCall `toString()`:\n\n```php\n$docblock-\u003etoString();\n```\n\nor if you are in a write-context, the magical `__toString()` will take care of it:\n\n```php\necho $docblock;\n```\n\n## Documentation Api\n\nSee https://phpowermove.github.io/docblock\n\n## Contributing\n\nFeel free to fork and submit a pull request (don't forget the tests) and I am happy to merge.\n\n## References\n\n- This project uses the parsers from [phpDocumentor/ReflectionDocBlock](https://github.com/phpDocumentor/ReflectionDocBlock)\n\n## Changelog\n\nRefer to [Releases](https://github.com/phpowermove/docblock/releases)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpowermove%2Fdocblock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpowermove%2Fdocblock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpowermove%2Fdocblock/lists"}