Download the PHP package donquixote/hasty-reflection-parser without Composer

On this page you can find all versions of the php package donquixote/hasty-reflection-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package hasty-reflection-parser

Build Status

hasty-reflection-parser

A library that parses PHP code to generate reflection objects.

It is called "hasty", because it skips and omits and ignores a lot of stuff, and only focuses on what one usually wants for e.g. annotation discovery.

Currently it ignores variable declarations, regular statements, function calls, object variables, function declarations, and more.

Use cases:
It is meant for stuff like Annotation discovery like in Doctrine or Drupal 8.

Partial libraries (as dependencies):

hasty-php-ast:
Abstract syntax tree. This is an incomplete representation of PHP !

hasty-php-parser:
The parser. Turns a PHP string into an AST graph. Based on token_get_all().

hasty-reflection-common:
Classes and interfaces similar to the core reflection API. Contains a working "native" implementation that uses core reflection instead of parsing.

hasty-reflection-parser:
Uses the parser to generate the reflection objects.

How to use

First, choose one of the various implementations of ClassIndexInterface. E.g.

Now you can get class reflection objects as you want.

The ClassIndex makes sure that only one reflection object exists for each class/interface/trait/method.

Performance

This thing should be quite fast, because the parser skips a lot of stuff. For long method or function bodies, it will simply fast-forward through the tokens, and only count opening and closing brackets!

It does currently NOT do the trick of cutting out the class body PHP. This is because it was made for a use case where we are really interested in the class body.

However, the class body will initially be read in fast mode, to be picked up later, if/when requested. (This is the "lazy" parameter for some classes).

The token array from token_get_all() is never sliced or manipulated, which means PHP only needs to pass around the array pointer, not create different versions the array itself.

The length of the token array is not remembered either, instead it is terminated by a unique symbol.

Status of this library

This is very fresh. Mabye some names will change in the near future!


All versions of hasty-reflection-parser with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
donquixote/hasty-reflection-common Version ~0.0
donquixote/hasty-php-ast Version ~0.0
donquixote/hasty-php-parser Version ~0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package donquixote/hasty-reflection-parser contains the following files

Loading the files please wait ....