2017 © Pedro Peláez
 

library code-metamodel-php

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

image

domaincoder/code-metamodel-php

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

  • Thursday, March 26, 2015
  • by hidenorigoto
  • Repository
  • 2 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

[WIP] CodeMetamodel-PHP

Code Metamodel for PHP, (*1)

Build Status SensioLabsInsight Total Downloads Latest Stable Version Latest Unstable Version Dependency Status, (*2)

Features

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

Installation

CodeMetamodel-PHP can be installed using Composer., (*3)

CAUTION: dev package is only available., (*4)

// 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:, (*5)

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

parse

This command parses codes under the TARGET_DIR and create model cache., (*6)

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

dump

This command dumps meta-model objects of a specified location., (*7)

$ 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:, (*8)

  • 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:, (*9)

  • 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:, (*10)

  • 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., (*11)

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

License

The BSD 2-Clause License, (*13)

The Versions

26/03 2015

dev-master

9999999-dev

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

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by GOTO Hidenori

metamodel