domaincoder/code-metamodel-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

domaincoder/code-metamodel-php

Composer 安装命令:

composer require domaincoder/code-metamodel-php

包简介

CodeMetamodel-PHP provides metamodel classes of PHP code and a parser which parses PHP codes and build metamodel objects.

关键字:

README 文档

README

Code Metamodel for PHP

Build Status SensioLabsInsight Total Downloads Latest Stable Version Latest Unstable Version Dependency Status

Features

  • Parser\Parser parses PHP sources under a project to generate metamodel objects (via CLI command).
  • Element\* are metamodel classes. Currently supports
    • namespace
    • use
    • class
    • class annotation
    • class inheritance
    • property
    • property annotation
    • property type resolving (only declared by use)
    • method
    • method annotation
  • Dumper\SimpleDumper dumps metamodel objects to simple text.

Installation

CodeMetamodel-PHP can be installed using Composer.

CAUTION: dev package is only available.

// composer.json
{
    "minimum-stability": "dev"
}

$ composer require domaincoder/code-metamodel-php

Commands

Some features of CodeMetamodel-PHP are provided via CLI commands. CLI commands can be ran as follows:

$ php bin/domaincoder-parser.php COMMAND_NAME TARGET_DIR (OPTIONS)

parse

This command parses codes under the TARGET_DIR and create model cache.

$ php bin/domaincoder-parser.php parse /path/to/project/root

dump

This command dumps meta-model objects of a specified location.

$ php bin/domaincoder-parser.php dump /path/to/project/root

filter-class

With this command you can search classes in a meta-model objects of a specified location. Options are:

  • annotation: Annotation name (ex. ORM\Entity, author)
  • comment: keyword (ex. related to tax)
$ php bin/domaincoder-parser.php filter-class /path/to/project/root --annotation=Route --comment=Test

filter-property

With this command you can search properties in a meta-model objects of a specified location. Options are:

  • annotation: Annotation name (ex. ORM\Entity, author)
  • comment: keyword (ex. related to tax)
$ php bin/domaincoder-parser.php filter-property /path/to/project/root --annotation=Route --comment=Test

filter-method

With this command you can search methods in a meta-model objects of a specified location. Options are:

  • annotation: Annotation name (ex. ORM\Entity, author)
  • comment: keyword (ex. related to tax)
$ php bin/domaincoder-parser.php filter-method /path/to/project/root --annotation=Route --comment=Test

Roadmap

  • v 0.0.1 implements parser which parses codes to build metamodel objects. saving model objects to a cache (APC) or json format.
  • v 0.0.2 adds filter commands.
  • v 0.0.3 adds modifying existing AST to add fields, change annotations, etc.

Support

If you find a bug or have a question, or want to request a feature, create an issue or pull request for it on Issues.

Copyright

Copyright (c) 2015 GOTO Hidenori, All rights reserved.

License

The BSD 2-Clause License

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-2-Clause
  • 更新时间: 2015-03-19