2017 © Pedro Peláez
 

library annotation-parser

image

donquixote/annotation-parser

  • Tuesday, August 29, 2017
  • by donquixote
  • Repository
  • 1 Watchers
  • 1 Stars
  • 23 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 5 % Grown

The README.md

Build Status, (*1)

Donquixote's Annotation Parser

Alternative to other annotation parsers. Specifically doctrine/annotations., (*2)

use Donquixote\Annotation\Parser\AnnotationParser;

$docText = '
  @Foo(
    x = "7",
    y = @Bar()
  )

  @return bool
';
$parser = new AnnotationParser($docText);
if (false !== $position = strpos('@Foo', $docText)) {
  $annotation = $parser->doctrineAnnotation($position);
}

Difference to the doctrine/annotations

There are two main differences: - Annotations are parsed into an abstract syntax tree (AST), before resolving identifiers and constants. - Unlike in Doctrine, there is no such a concept like "annotation classes". An annotation name is just a string, it is not interpreted a class alias., (*3)

This being said, I imagine it not too hard to implement Doctrine's "annotation class" concept on top of this library., (*4)

Use case

For now, I created this to use it in my own projects, such as https://drupal.org/project/cfr. For this project I did not need "annotation classes". I might change my mind in the future., (*5)

If others find it useful, let me know!, (*6)

The Versions

29/08 2017

1.0.x-dev

1.0.9999999.9999999-dev

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

by Andreas Hennings

29/08 2017

v1.0.0-alpha3

1.0.0.0-alpha3

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

by Andreas Hennings

29/08 2017

0.0.x-dev

0.0.9999999.9999999-dev

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

by Andreas Hennings

29/08 2017

v1.0.0-alpha2

1.0.0.0-alpha2

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

by Andreas Hennings

29/08 2017

v1.0.0-alpha1

1.0.0.0-alpha1

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

by Andreas Hennings

04/08 2017

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

by Andreas Hennings

24/08 2016

v0.0.0-alpha1

0.0.0.0-alpha1

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

by Andreas Hennings