PHP Classes
elePHPant
Icontem

File: vendor/phpdocumentor/reflection-docblock/examples/02-interpreting-tags.php

Recommend this page to a friend!
  Classes of Renato De Oliveira Lucena  >  PHP Pokemon Script  >  vendor/phpdocumentor/reflection-docblock/examples/02-interpreting-tags.php  >  Download  
File: vendor/phpdocumentor/reflection-docblock/examples/02-interpreting-tags.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Pokemon Script
Provides an API to manage a database of Pokemons
Author: By
Last change:
Date: 1 year ago
Size: 629 bytes
 

 

Contents

Class file image Download
<?php
require_once(__DIR__ . '/../vendor/autoload.php');

use
phpDocumentor\Reflection\DocBlockFactory;

$docComment = <<<DOCCOMMENT
/**
 * This is an example of a summary.
 *
 * @see \phpDocumentor\Reflection\DocBlock\StandardTagFactory
 */
DOCCOMMENT;

$factory = DocBlockFactory::createInstance();
$docblock = $factory->create($docComment);

// You can check if a DocBlock has one or more see tags
$hasSeeTag = $docblock->hasTag('see');

// Or we can get a complete list of all tags
$tags = $docblock->getTags();

// But we can also grab all tags of a specific type, such as `see`
$seeTags = $docblock->getTagsByName('see');