argo-php/docblock-parser

There is no license information available for the latest version (v1.0.0) of this package.

PHP DocBlock parser

Installs: 2

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:package

pkg:composer/argo-php/docblock-parser

v1.0.0 2025-11-25 20:46 UTC

This package is auto-updated.

Last update: 2025-11-25 20:47:07 UTC


README

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);