cvc/twig-documentor

Automatically generates documentation for Twig extensions.

0.3.1 2021-04-13 20:21 UTC

This package is auto-updated.

Last update: 2024-12-14 22:06:41 UTC


README

Continuous Integration codecov Packagist Psalm coverage GitHub license

Automatically generates documentation for Twig extensions.

Installation

composer require --dev cvc/twig-documentor

Usage

<?php

$environment = new \Twig\Environment(new \Twig\Loader\ArrayLoader());
$environmentDescriber = new \Cvc\TwigDocumentor\Describer\EnvironmentDescriber(
    new \Cvc\TwigDocumentor\Describer\FunctionDescriber(\phpDocumentor\Reflection\DocBlockFactory::createInstance()),
    new \Cvc\TwigDocumentor\Describer\FilterDescriber(\phpDocumentor\Reflection\DocBlockFactory::createInstance())
);
$documentation = $environmentDescriber->describe($environment);
$documentation = $documentation->withSource(__DIR__.'/*');

Development Team