1. Go to this page and download the library: Download jworman/annotation-reader 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/ */
jworman / annotation-reader example snippets
use JWorman\AnnotationReader\AbstractAnnotation;
class MyAnnotation extends AbstractAnnotation
{
}
use MyAnnotation;
class Example
{
/**
* @MyAnnotation("fizzbuzz")
*/
private $id;
}
use JWorman\AnnotationReader\AnnotationReader;
$annotationReader = new AnnotationReader();
$reflectionProperty = new \ReflectionProperty('Example', 'id');
$annotation = $annotationReader->getPropertyAnnotation($reflectionProperty, 'MyAnnotation');
$value = $annotation->getValue(); // Returns "fizzbuzz"
use JWorman\AnnotationReader\AbstractAnnotation;
class AnotherOne extends AbstractAnnotation
{
private $isCool; // From above annotations will equal: true
private $list; // From above annotations will equal: [null, false, \stdObject()]
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.