Name: plugin-php
Owner: Prettier
Description: Prettier PHP Plugin
Created: 2017-12-24 02:56:22.0
Updated: 2018-05-24 17:12:04.0
Pushed: 2018-05-12 15:17:02.0
Homepage: null
Size: 698
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
:construction: Work in Progress! :construction:
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.
Prettier is an opinionated code formatter. It 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.
This plugin adds support for the PHP language to Prettier.
y_map(function($arg1,$arg2) use ( $var1, $var2 ) {
return $arg1+$arg2/($var+$var2);
rray("complex"=>"code","with"=>"inconsistent","formatting"=>"is", "hard" => "to", "maintain"=>true));
y_map(
function ($arg1, $arg2) use ($var1, $var2) {
return $arg1 + $arg2 / ($var + $var2);
},
array(
"complex" => "code",
"with" => "inconsistent",
"formatting" => "is",
"hard" => "to",
"maintain" => true
)
You'll need a current development version of prettier, because the plugin depends on currently unreleased features.
yarn:
add --dev prettier/prettier prettier/plugin-php
globally
global add prettier/prettier prettier/plugin-php
npm:
install --save-dev prettier/prettier prettier/plugin-php
globally
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
,
ipts": {
rettier": "prettier"
and then run it via
run prettier path/to/file.php --write
run prettier -- path/to/file.php --write
If you installed globally, run
tier 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:
yarn
.test.php
.yarn prettier test.php
to check the output.Mike Grip | Christian Zosel | Evilebot Tnawi |