承接 donquixote/annotation-parser 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

donquixote/annotation-parser

Composer 安装命令:

composer require donquixote/annotation-parser

包简介

README 文档

README

Build Status

Donquixote's Annotation Parser

Alternative to other annotation parsers. Specifically doctrine/annotations.

Usage

Look into AnnotationReaderTest for inspiration.

The non-trivial part is to create the AnnotationReader, more specifically the AnnotationResolver, from smaller components, depending on the desired behavior.

Difference to doctrine/annotations

The main difference is that annotation parsing in this library happens in two steps:

  1. Parsing the doc comment into an abstract syntax tree (AST).
  2. Resolving this AST into annotation objects or any other kind of structure.

This separations allows to remove some assumptions of how annotations work, and make them optional.

E.g. in Doctrine, the idea is that an annotation tag name refers to a class name or class alias, and parsing the annotation means instantiating this class. Here, this behavior is just one possibility among others.

In Doctrine, the way an annotation class is instantiated depends on metadata on the annotation class. Here, such behavior could be implemented as an InstantiatorFinder, but it is not baked into the main architecture.

It is interesting to know that Doctrine is currently planning a 2.x branch, see doctrine/annotations#75. There is also an interesting issue at doctrine/annotations#139.

Stability

For the 1.0 branch I might still do some renames, which are guaranteed to break user code. So treat it as preview quality!

However, any other projects that I maintain that depend on this library will be ok.

The 0.0 branch is kinda stable, as far as BC breaks are concerned.

Use case

For now, I created this to use it in my own projects, such as https://drupal.org/project/cfr. At the time I started this, doctrine/annotations did not feel like the right tool.

If others find it useful, let me know!

统计信息

  • 总下载量: 821
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-08-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固