Skip to content

argo-php/docblock-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

argo/docblock-parser

PHPDoc parser. Unlike existing solutions, it immediately returns types in package format argo-php/types.

Usage

Parsing PHPDoc from a string:

use Argo\DocBlockParser\Parser;
use Argo\DocBlockParser\Context\ContextFactory;
use Argo\DocBlockParser\PhpDocFactory;

$phpDocParser = new Parser();
$phpDoc = $phpDocParser->parse('/** @var string $hello */');

Getting all PHPDoc tags from reflection:

use Argo\DocBlockParser\Parser;
use Argo\DocBlockParser\Context\ContextFactory;
use Argo\DocBlockParser\PhpDocFactory;

$phpDocFactory = new PhpDocFactory(new Parser(), new ContextFactory());

$reflection = new \ReflectionClass('MyClassWithPhpDoc');
$phpDoc = $phpDocFactory->getPhpDocFromReflector($reflection);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages