https://github.com/voku/php-doc-fixer
This is an experiment! Let's check / fix the PHP documentation automatically.
https://github.com/voku/php-doc-fixer
hacktoberfest php php-docs
Last synced: 7 months ago
JSON representation
This is an experiment! Let's check / fix the PHP documentation automatically.
- Host: GitHub
- URL: https://github.com/voku/php-doc-fixer
- Owner: voku
- License: apache-2.0
- Created: 2020-11-15T23:37:59.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T11:50:46.000Z (almost 2 years ago)
- Last Synced: 2024-10-29T22:47:03.403Z (12 months ago)
- Topics: hacktoberfest, php, php-docs
- Language: PHP
- Homepage:
- Size: 272 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# ***PHP-Documentation-Check***
This is a experiment! Lets check and fix the php documentation automatically.
### install
```bash
git clone https://github.com/php/doc-en.git // optional: only if you want to check it
git clone https://github.com/php/php-src.git // optional: by default we use the PhpStorm Stubs from vendor directory but you can also use different stubs
git clone https://github.com/jetbrains/phpstorm-stubs.git // optional: by default we use the PhpStorm Stubs from vendor directory but you can also use external stubs
git clone https://github.com/vimeo/psalm.git // optional: only if you want to check it
git clone https://github.com/phpstan/phpstan-src.git // optional: only if you want to check it
git clone https://github.com/voku/php-doc-fixer.git
cd php-doc-fixer/
composer update --prefer-dist
```### command for analysing static code analysis stubs (PHPStan, Psalm, ...)
```
php bin/phpdocfixer static_analysis [--remove-array-value-info="true"] [--stubs-path="vendor/jetbrains/phpstorm-stubs/"] [--stubs-file-extension=".php"] ../phpstan-src/resources/functionMap.php
```#### example: check types from php-src against static code analysis stubs from PHPStan
```
php bin/phpdocfixer static_analysis --remove-array-value-info="true" --stubs-path="../php-src/" --stubs-file-extension=".stub.php" ../phpstan-src/resources/functionMap.php
```#### example: check types from phpstorm-stubs (mysqli) against static code analysis stubs from PHPStan
```
php bin/phpdocfixer static_analysis --stubs-path="../phpstorm-stubs/mysqli/" ../phpstan-src/resources/functionMap.php
```#### example: check types from PhpStorm stubs against static code analysis stubs from Psalm
```
php bin/phpdocfixer static_analysis ../psalm/src/Psalm/Internal/CallMap.php
```### command for analysing and fixing the php documentation
```
php bin/phpdocfixer run [--auto-fix="true"] [--remove-array-value-info="true"] [--stubs-path="../php-src/"] [--stubs-file-extension=".stub.php"] ../doc-en/reference/
```#### example: sync types from PhpStorm Stubs into the php-documentation
```
php bin/phpdocfixer run --auto-fix="true" --remove-array-value-info="true" ../doc-en/reference/
```#### example: sync types from php-src into the php-documentation, but only for BCMath (bc)
```
php bin/phpdocfixer run --auto-fix="true" --stubs-path="../php-src/" --stubs-file-extension=".stub.php" ../doc-en/reference/bc/
```