Download the PHP package egorov/yii2-annotations without Composer

On this page you can find all versions of the php package egorov/yii2-annotations. 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 yii2-annotations

Yii2 Annotations extension

Master: Scrutinizer Code Quality Code Coverage Build Status

Develop: Scrutinizer Code Quality Code Coverage Build Status

Use doctrine/annotations in Yii2 projects with Yii2 caching drivers

Install **Configuration**
where :

class - yii\annotations\Annotations class or class implementing yii\annotations\AnnotationsInterface,
cache - Optional. Container with cache component defined in configuration or cache class. By default 'cache',
path -  Optional. Annotations cache dir for \yii\caching\FileCache,
debug - Optional boolean. Debug enable. True means that the cache will be invalid every time the file is changed, false - the cache will be generated once
ignoreAnnotations - List of ignored annotations when parsing a file

Annotation class

Annotation classes have to contain a class-level docblock with the text @Annotation: `

Inject annotation values

The annotation parser check if the annotation constructor has arguments, if so then we will pass the value array, otherwise will try to inject values into public properties directly: `

Annotation Target

@Target indicates the kinds of class element to which an annotation type is applicable. Then you could define one or more targets:

CLASS Allowed in the class docblock PROPERTY Allowed in the property docblock METHOD Allowed in the method docblock ALL Allowed in the class, property and method docblock ANNOTATION Allowed inside other annotations If the annotations is not allowed in the current context you got an AnnotationException `

Attribute types

Annotation parser check the given parameters using the phpdoc annotation @var, The data type could be validated using the @var annotation on the annotation properties or using the annotations @Attributes and @Attribute.

If the data type not match you got an AnnotationException ` Annotation Required

@Required indicates that the field must be specified when the annotation is used. If it is not used you get an AnnotationException stating that this value can not be null.

Declaring a required field: Usage: Enumerated values

An annotation property marked with @Enum is a field that accept a fixed set of scalar values. You should use @Enum fields any time you need to represent fixed values. The annotation parser check the given value and throws an AnnotationException if the value not match. Declaring an enumerated property:

Annotation usage: Constants

The use of constants and class constants are available on the annotations parser.

The following usage are allowed: ` Be careful with constants and the cache !

The cached reader will not re-evaluate each time an annotation is loaded from cache. When a constant is changed the cache must be cleaned.

Usage Example

Create annotations class Write annotations in target class

Reader API

Access all annotations of a class `

Access one annotation of a class `

Access all annotations of a method `

Access one annotation of a method `

Access all annotations of a property `

Access one annotation of a property `

Get parser

Parse annotation directly from docBlock. Its not cached


All versions of yii2-annotations with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
doctrine/annotations Version ^1.10
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 egorov/yii2-annotations contains the following files

Loading the files please wait ...