cvc / twig-documentor
Automatically generates documentation for Twig extensions.
0.3.1
2021-04-13 20:21 UTC
Requires
- php: ~7.3.0 || ~7.4.0 || ~8.0.0
- phpdocumentor/reflection-docblock: ^5
- twig/twig: ^3.0
Requires (Dev)
- ergebnis/composer-normalize: ^2.3
- friendsofphp/php-cs-fixer: ^2.16.3
- phpunit/phpunit: ^9
- symfony/var-dumper: ^3 || ^4
- vimeo/psalm: ^4.7.0
README
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__.'/*');