Prettier PHP plugin
- Author(s)
- (( authors ))
- Company
- (( companies ))
- (( resource.label ))
- (( resource.mask ))
- Dependencies
- (( dependencies ))
Prettier PHP plugin adds support for the PHP language to Prettier, an opinionated code formatter.
Prettier enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.
Note: this plugin can also be integrated with php-cs-fixer.
See docs/recipes/php-cs-fixer
for integration help,
code can also be found in https://gist.github.com/Billz95/9d5fad3af728b88540fa831b73261733
Installation
Install from a Node package as a dev dependency (with npm or yarn)
Make sure you have npm or yarn installed.
Require it as a dev dependency:
or
Run it:
or
yarn add --dev
[email protected]
@prettier/[email protected]
or
npm install --save-dev
[email protected]
@prettier/[email protected]
Run it:
yarn run prettier path/to/file.php --write
or
npm run prettier -- path/to/file.php --write
Install from a Node package as a global dependency (with npm or yarn)
Make sure you have npm or yarn installed.
Require it as a global dependency:
or
Run it:
or
yarn global add
[email protected]
@prettier/[email protected]
or
npm install --global
[email protected]
@prettier/[email protected]
Run it:
yarn run prettier path/to/file.php --write
or
npm run prettier -- path/to/file.php --write