PHP code example of bvarent / doc-block-tags

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

    

bvarent / doc-block-tags example snippets


// A class we want to read the tags from.
$testClassName = 'DocBlockTags\Tests\Mock\TaggedClass';

// Get your ZF2 servicemanager from somewhere.
$serviceManager = DocBlockTags\Tests\Bootstrap::getServiceManager();

// Get a Doctrine ReflectionClass for our class.
$classFinder = $serviceManager->get('DocBlockTags\ClassFinder');
$reflParser = new Doctrine\Common\Reflection\StaticReflectionParser($testClassName, $classFinder);
$testClassRefl = $reflParser->getReflectionClass();

// Read some tags.
$tagReader = $serviceManager->get('DocBlockTags\TagReader');
$tags = $tagReader->getClassAnnotations($testClassRefl);