PHP code example of danineto / annotations

1. Go to this page and download the library: Download danineto/annotations 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/ */

    

danineto / annotations example snippets


use Danineto\Annotations\AsMethod;
use Danineto\Annotations\Common\AnnotationReader;

$class = new class
{
    /**
     * @AsMethod(name="getExample")
     */
    function method()
    {
        return true;
    }
};

$reader = new AnnotationReader()
$methods = $reader->getMethodByAnnotation($class, AsMethod::class, [
    'name' => 'getExample'
]);

var_dump($methods);