Download the PHP package mamazu/documentation-validator without Composer
On this page you can find all versions of the php package mamazu/documentation-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mamazu/documentation-validator
More information about mamazu/documentation-validator
Files in mamazu/documentation-validator
Package documentation-validator
Short Description A validator tool that can validate markdown documentation
License MIT
Informations about the package documentation-validator
Documentation validator
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.
Installation
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>
How to use it
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.
Supported parsing formats
Here is the full list of parsers that this library supports:
- IgnoredFileParser (this allows ignoring certain extensions like pdf files)
- Markdown (only supporting block comments for now)
- RstParser
- LatexParser (only supporting the
lstlisting
package)
Validators
- CompositeValidator: Validates all of its children passed into the constructor
- Bash:
- BashValidator: Validates bash or sh files with the build in spellchecker
- PHP:
- ClassExistenceValidator: Validates if the classes referenced in the use statement exist
- PhpStanValidator (optional): Validates the code with PHPstan
- EnvValidator: Validate the contents of the
.env
files
- XML:
- XMLValidator: Checks if the document contains valid XML
- YAML / YML:
- YamlValidator: Checks if the document contains valid Yaml
- JSON:
- JsonValidator: Default PHP JSON parsing without line numbers of errors
All versions of documentation-validator with dependencies
ext-dom Version *
ext-libxml Version *
ext-json Version *
nikic/php-parser Version ^4.2
symfony/yaml Version ^4|^5
mamazu/rst Version ^2.0
symfony/filesystem Version ^4|^5.3