2017 © Pedro Peláez
 

library docblock

PHP Docblock parser and generator. An API to read and write Docblocks.

image

gossi/docblock

PHP Docblock parser and generator. An API to read and write Docblocks.

  • Saturday, July 1, 2017
  • by gossi
  • Repository
  • 3 Watchers
  • 14 Stars
  • 82,923 Installations
  • PHP
  • 7 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 9 Versions
  • 13 % Grown

The README.md

Docblock

License Latest Stable Version Total Downloads Tests Coverage report Scrutinizer Code Quality Code Coverage, (*1)

PHP Docblock parser and generator. An API to read and write Docblocks., (*2)

WARNING: starting from version 4.0 the library has moved to phpowermove organization and the namespace is phpowermove\docblock., (*3)

Installation

Install via Composer:, (*4)

composer require phpowermove/docblock

Usage

1. Generate a Docblock instance

a) Simple:, (*5)

use phpowermove\docblock\Docblock;

$docblock = new Docblock();

b) Create from string:, (*6)

use phpowermove\docblock\Docblock;

$docblock = new Docblock('/**
 * Short Description.
 *
 * Long Description.
 *
 * @author gossi
 */');

c) Create from reflection:, (*7)

use phpowermove\docblock\Docblock;

$docblock = new Docblock(new \ReflectionClass('MyClass'));

2. Manipulate tags

Get the tags:, (*8)

$tags = $docblock->getTags();

Get tags by name:, (*9)

$tags = $docblock->getTags('author');

Append a tag:, (*10)

use phpowermove\docblock\tags\AuthorTag;

$author = new AuthorTag();
$author->setName('gossi');
$docblock->appendTag($author);

or with fluent API:, (*11)

use phpowermove\docblock\tags\AuthorTag;

$docblock->appendTag(AuthorTag::create()
    ->setName('gossi')
);

Check tag existence:, (*12)

$docblock->hasTag('author');

3. Get back the string

Call toString():, (*13)

$docblock->toString();

or if you are in a write-context, the magical __toString() will take care of it:, (*14)

echo $docblock;

Documentation Api

See https://phpowermove.github.io/docblock, (*15)

Contributing

Feel free to fork and submit a pull request (don't forget the tests) and I am happy to merge., (*16)

References

Changelog

Refer to Releases, (*17)

The Versions

01/07 2017

dev-master

9999999-dev

PHP Docblock parser and generator. An API to read and write Docblocks.

  Sources   Download

MIT

The Requires

 

The Development Requires

parser generator docblock

01/07 2017

v1.6

1.6.0.0

PHP Docblock parser and generator. An API to read and write Docblocks.

  Sources   Download

MIT

The Requires

 

The Development Requires

parser generator docblock

18/09 2015

v1.5

1.5.0.0

PHP Docblock parser and generator. An API to read and write Docblocks.

  Sources   Download

MIT

The Requires

 

The Development Requires

parser generator docblock

15/05 2015

v1.4

1.4.0.0

PHP Docblock parser and generator. An API to read and write Docblocks.

  Sources   Download

MIT

The Requires

 

The Development Requires

parser generator docblock

04/11 2014

v1.3

1.3.0.0

PHP Docblock parser and generator. An API to read and write Docblocks.

  Sources   Download

MIT

The Requires

 

The Development Requires

parser generator docblock

04/11 2014

v1.2

1.2.0.0

PHP DocBlock parser and generator. An API to read and write DocBlocks.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

parser generator docblock

28/05 2014

v1.1

1.1.0.0

PHP DocBlock parser and generator. An API to read and write DocBlocks.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

parser generator docblock

28/05 2014

v1.0.1

1.0.1.0

PHP DocBlock parser and generator. An API to read and write DocBlocks.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

parser generator docblock

28/05 2014

v1.0

1.0.0.0

PHP DocBlock parser and generator. An API to read and write DocBlocks.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

parser generator docblock