sinsquare / phpdoc-formatter
A tool to automatically fix phpDocumentor tags and annotations
Installs: 12 099
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 0
Open Issues: 0
Type:application
Requires
- php: ^5.6 || >=7.0
- symfony/finder: >=4.0
- symfony/polyfill-php70: >=1.0
- symfony/polyfill-php72: >=1.4
- symfony/stopwatch: >=4.0
Requires (Dev)
- friendsofphp/php-cs-fixer: >=2.0
- phpunit/phpunit: >=6.0
README
A simple tool for formatting PHPDoc
The tool currently fixes:
- Idention through multiline comments
- Removing more than 2 empty lines
- Fixing PHPDoc format
Usage:
phpdoc-formatter [--option value] [/path/to/project ...]
Options:
--exclude (-e) Exclude path(s)
ex: --exclude vendor,library
--version (-v) Displays the version
--ident (-i) Sets the ident character(s)
ex: --ident " "
--newline (-n) Sets the newline character(s)
ex: --ident "\r\n"
--help (-h) Displays this message
Example:
Before:
/**
* @SWG\Info(
* title="API",
* version="1.0"
* )
*
* @SWG\Swagger(
* host=API_HOST,
* basePath=API_BASE_PATH
* )
*
* @SWG\SecurityScheme(
* securityDefinition="JWTTokenAuth",
* type="apiKey",
* in="header",
* name="Authorization",
* description=API_DEFAULT_TOKEN,
* )
*/
After:
/**
* @SWG\Info(
* title="API",
* version="1.0"
* )
*
* @SWG\Swagger(
* host=API_HOST,
* basePath=API_BASE_PATH
* )
*
* @SWG\SecurityScheme(
* securityDefinition="JWTTokenAuth",
* type="apiKey",
* in="header",
* name="Authorization",
* description=API_DEFAULT_TOKEN,
* )
*/