Download the PHP package bulton-fr/annotation without Composer

On this page you can find all versions of the php package bulton-fr/annotation. 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 annotation

Annotations reader system

Build Status Code Coverage Scrutinizer Code Quality

Latest Stable Version Latest Unstable Version License

Install it

With composer composer require bulton-fr/annotation.

Use it

First, the system need to parse your class :

And to obtain all annotations find, you have methods :

The class Parser\AbstractManyParser implement the class Iterator, so you use a foreach on it. Each item will be an instance of Parser\AbstractParser.
To obtain the array which contain all annotation (like the array returned by obtain*AnnotList) from the Parser\AbstractParser class, you should use the method getAnnotList().

The array returned by obtain*AnnotList has the format : Annotations\AbstractAnnotation[<int>][<string>].

So for example :

The annotations list will have the format :

All annotations objects

When an annotation is found by the parser, an instance of Parsers\Annotations\Info is instanced, which will contain all info about the annotation. There are:

With info into this object, a new object is instanced. When an annotation is declared, a class name is present. This class will be instanced each time this annotation is found.
It's this object (not the Info object) you will obtain by methods obtain*AnnotList.

The class used for the annotation must extends Annotations\AbstractAnnotation. Into it, you have access to the Reader, the Info object, you can detect if a key has been declared and obtain the value for a key.

You can find many example how to create a new class dedicated to an annotation :

Import namespace

Many annotations systems use classes declared for the class (with php use keyword). I make the choice not to use it, mainly to not read the disk each time. So all annotation you will use need to be "imported".
To import an annotation, two choice :

To declare a new annotation, you need two things :

Declare the namespace on the parser

To do that, we use the method addImportedNS on the ParserManager.

Now, into the myClass (annotation in class, methods and properties docblocks), I can use the annotation @CustomAnnot.

With the annotation AddNS

This annotation can be added only on the class docblock. If this annotation is present on properties or methods, they will be no effect.

Of course, you can use the imported annotation directly. When the system have all Info object, it read all AddNS first, and after it read all other annotations (so the order in docblock is not important).

Example

Ignore an annotation

Some annotations are ignored by the system. For example, all annotations used by docblock like @param etc. The list of ignored annotation is in Parsers\Annotations\Reader::ignoredAnnotations.
The list is based on the "tag reference" in the phpDocumentor documentation.
If you see missing annotation on the list, you can create an issue or a pull-request ;)

You can add a new annotation to ignore with Parsers\Annotations\Reader::addIgnoredAnnotation.

The property ignoredAnnotations and associated methods (getter and add) are static. So you need to declare it once for all instances.


All versions of annotation with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2.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 bulton-fr/annotation contains the following files

Loading the files please wait ....