A documentation parser and validator
MIT License
Every project needs documentation which is usually accompanied by code snippets that show how a component is integrated. The problem is how does the project ensure that this code runs and that the code is up to date? Then this is your tool.
This is a dev only package. Installing it without dev dependencies will cause problems.
composer require --dev mamazu/documentation-validator
vendor/bin/doc-parser <files to check>
bin/phpdoc-parser <path> [-i extensionscript.php]
path Path containing the documentation
-i script.php Configuration script of the application
Example:
bin/doc-parser docs # Validate with default configuration
bin/doc-parser docs -i config.php # Validate with custom configuration
The configuration of the extension is loaded before the application starts. For a template checkout the tests/extensions/delete.php
file. An example for adding more validators is given in the tests/extensions/add_phpstan.php
file which also adds the validation rules of PHPstan.
Here is the full list of parsers that this library supports:
lstlisting
package).env
files