PHP code example of leaditin / annotations

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

    

leaditin / annotations example snippets


$collector = new \Leaditin\Annotations\Collector\MemoryCollector(
    new \Leaditin\Annotations\Reader\ReflectionReader()
);
$reflection = $collector->read(\Leaditin\Annotations\Reflection::class);

foreach ($reflection->getClassAnnotations() as $annotation) {
    printf('@%s %s%s',
        $annotation->getName(),
        $annotation->getArgument(0),
        PHP_EOL
    );
}