1. Go to this page and download the library: Download bulton-fr/annotation library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bulton-fr / annotation example snippets
$annotations = new \BultonFr\Annotation\Reader(myClass::class);
$annotations->parse();
/**
* Add a new imported namespace (obtain by AddNS or manually)
*
* @param string $name The class path (with ns) of the class which will be
* instancied when the annotation defined by $alias will be found.
* @param string $alias The annotation key
*
* @return void
*/
public function addImportedNS(string $name, string $alias)
$annotations = new \BultonFr\Annotation\Reader(myClass::class);
$annotations->getParserManager()->addImportedNS(
\myApp\myCustomAnnotation::class
'CustomAnnot'
);
$annotations->parse();
/**
* My class description
*
* @AddNS(ns="\myApp\myCustomAnnotation", alias="CustomAnnot")
* @CustomAnnot(...)
*/
class myClass
/**
* Add a new annotation to ignore
*
* @param string $annotationName The annotation's name to ignore
* It's the part after the @.
*
* @return void
*/
public static function addIgnoredAnnotation(string $annotationName)
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.