🚧 Work in Progress! 🚧
Please note that this plugin is currently in alpha stage and still under active development. We encourage everyone to try it and give feedback, but we don't recommend it for production use yet.
You'll need a current development version of prettier, because the plugin depends on currently unreleased features.
yarn:
yarn add --dev prettier/prettier @prettier/plugin-php
# or globally
yarn global add prettier/prettier @prettier/plugin-php
npm:
npm install --save-dev prettier/prettier @prettier/plugin-php
# or globally
npm install --global prettier/prettier @prettier/plugin-php
If you installed prettier as a local dependency, you can add prettier as a script in your package.json
,
"scripts": {
"prettier": "prettier"
}
and then run it via
yarn run prettier path/to/file.php --write
# or
npm run prettier path/to/file.php --write
If you installed globally, run
prettier path/to/file.php --write
If you're interested in contributing to the development of Prettier for PHP, you can follow the CONTRIBUTING guide from Prettier, as it all applies to this repository too.
To test it out on a PHP file:
- Clone this repository.
- Run
yarn
. - Create a file called
test.php
. - Run
yarn prettier test.php
to check the output.
Mike Grip |
Christian Zosel |
Evilebot Tnawi |