README.rst 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853
  1. PHP Coding Standards Fixer
  2. ==========================
  3. The PHP Coding Standards Fixer tool fixes *most* issues in your code when you
  4. want to follow the PHP coding standards as defined in the PSR-1 and PSR-2
  5. documents and many more.
  6. If you are already using a linter to identify coding standards problems in your
  7. code, you know that fixing them by hand is tedious, especially on large
  8. projects. This tool does not only detect them, but also fixes them for you.
  9. Requirements
  10. ------------
  11. PHP needs to be a minimum version of PHP 5.3.6.
  12. Installation
  13. ------------
  14. Locally
  15. ~~~~~~~
  16. Download the `php-cs-fixer.phar`_ file and store it somewhere on your computer.
  17. Globally (manual)
  18. ~~~~~~~~~~~~~~~~~
  19. You can run these commands to easily access ``php-cs-fixer`` from anywhere on
  20. your system:
  21. .. code-block:: bash
  22. $ wget http://get.sensiolabs.org/php-cs-fixer.phar -O php-cs-fixer
  23. # With a specific version
  24. $ wget http://get.sensiolabs.org/php-cs-fixer-v1.11.phar -O php-cs-fixer
  25. or with curl:
  26. .. code-block:: bash
  27. $ curl http://get.sensiolabs.org/php-cs-fixer.phar -o php-cs-fixer
  28. # With a specific version
  29. $ curl http://get.sensiolabs.org/php-cs-fixer-v1.11.phar -o php-cs-fixer
  30. then:
  31. .. code-block:: bash
  32. $ sudo chmod a+x php-cs-fixer
  33. $ sudo mv php-cs-fixer /usr/local/bin/php-cs-fixer
  34. Then, just run ``php-cs-fixer``.
  35. Globally (Composer)
  36. ~~~~~~~~~~~~~~~~~~~
  37. To install PHP-CS-Fixer, install Composer and issue the following command:
  38. .. code-block:: bash
  39. $ ./composer.phar global require fabpot/php-cs-fixer
  40. Then make sure you have ``~/.composer/vendor/bin`` in your ``PATH`` and
  41. you're good to go:
  42. .. code-block:: bash
  43. export PATH="$PATH:$HOME/.composer/vendor/bin"
  44. Globally (homebrew)
  45. ~~~~~~~~~~~~~~~~~~~
  46. PHP-CS-Fixer is part of the homebrew-php project. Follow the installation
  47. instructions at https://github.com/homebrew/homebrew-php if you don't
  48. already have it.
  49. .. code-block:: bash
  50. $ brew install homebrew/php/php-cs-fixer
  51. Update
  52. ------
  53. Locally
  54. ~~~~~~~
  55. The ``self-update`` command tries to update ``php-cs-fixer`` itself:
  56. .. code-block:: bash
  57. $ php php-cs-fixer.phar self-update
  58. Globally (manual)
  59. ~~~~~~~~~~~~~~~~~
  60. You can update ``php-cs-fixer`` through this command:
  61. .. code-block:: bash
  62. $ sudo php-cs-fixer self-update
  63. Globally (Composer)
  64. ~~~~~~~~~~~~~~~~~~~
  65. You can update ``php-cs-fixer`` through this command:
  66. .. code-block:: bash
  67. $ ./composer.phar global update fabpot/php-cs-fixer
  68. Globally (homebrew)
  69. ~~~~~~~~~~~~~~~~~~~
  70. You can update ``php-cs-fixer`` through this command:
  71. .. code-block:: bash
  72. $ brew upgrade php-cs-fixer
  73. Usage
  74. -----
  75. The ``fix`` command tries to fix as much coding standards
  76. problems as possible on a given file or files in a given directory and its subdirectories:
  77. .. code-block:: bash
  78. php php-cs-fixer.phar fix /path/to/dir
  79. php php-cs-fixer.phar fix /path/to/file
  80. The ``--format`` option for the output format. Supported formats are ``txt`` (default one), ``json`` and ``xml``.
  81. The ``--verbose`` option will show the applied fixers. When using the ``txt`` format it will also displays progress notifications.
  82. The ``--level`` option limits the fixers to apply on the
  83. project:
  84. .. code-block:: bash
  85. php php-cs-fixer.phar fix /path/to/project --level=psr0
  86. php php-cs-fixer.phar fix /path/to/project --level=psr1
  87. php php-cs-fixer.phar fix /path/to/project --level=psr2
  88. php php-cs-fixer.phar fix /path/to/project --level=symfony
  89. By default, all PSR-2 fixers and some additional ones are run. The "contrib
  90. level" fixers cannot be enabled via this option; you should instead set them
  91. manually by their name via the ``--fixers`` option.
  92. The ``--fixers`` option lets you choose the exact fixers to
  93. apply (the fixer names must be separated by a comma):
  94. .. code-block:: bash
  95. php php-cs-fixer.phar fix /path/to/dir --fixers=linefeed,short_tag,indentation
  96. You can also blacklist the fixers you don't want by placing a dash in front of the fixer name, if this is more convenient,
  97. using ``-name_of_fixer``:
  98. .. code-block:: bash
  99. php php-cs-fixer.phar fix /path/to/dir --fixers=-short_tag,-indentation
  100. When using combination with exact and blacklist fixers, apply exact fixers along with above blacklisted result:
  101. .. code-block:: bash
  102. php php-cs-fixer.phar fix /path/to/dir --fixers=linefeed,-short_tag
  103. A combination of ``--dry-run`` and ``--diff`` will
  104. display summary of proposed fixes, leaving your files unchanged.
  105. The command can also read from standard input, in which case it won't
  106. automatically fix anything:
  107. .. code-block:: bash
  108. cat foo.php | php php-cs-fixer.phar fix --diff -
  109. Choose from the list of available fixers:
  110. * **psr0** [PSR-0]
  111. Classes must be in a path that
  112. matches their namespace, be at
  113. least one namespace deep, and
  114. the class name should match
  115. the file name.
  116. * **encoding** [PSR-1]
  117. PHP code MUST use only UTF-8
  118. without BOM (remove BOM).
  119. * **short_tag** [PSR-1]
  120. PHP code must use the long
  121. <?php ?> tags or the
  122. short-echo <?= ?> tags; it
  123. must not use the other tag
  124. variations.
  125. * **braces** [PSR-2]
  126. The body of each structure
  127. MUST be enclosed by braces.
  128. Braces should be properly
  129. placed. Body of braces should
  130. be properly indented.
  131. * **class_definition** [PSR-2]
  132. Whitespace around the key
  133. words of a class, trait or
  134. interfaces definition should
  135. be one space.
  136. * **elseif** [PSR-2]
  137. The keyword elseif should be
  138. used instead of else if so
  139. that all control keywords
  140. looks like single words.
  141. * **eof_ending** [PSR-2]
  142. A file must always end with a
  143. single empty line feed.
  144. * **function_call_space** [PSR-2]
  145. When making a method or
  146. function call, there MUST NOT
  147. be a space between the method
  148. or function name and the
  149. opening parenthesis.
  150. * **function_declaration** [PSR-2]
  151. Spaces should be properly
  152. placed in a function
  153. declaration.
  154. * **indentation** [PSR-2]
  155. Code MUST use an indent of 4
  156. spaces, and MUST NOT use tabs
  157. for indenting.
  158. * **line_after_namespace** [PSR-2]
  159. There MUST be one blank line
  160. after the namespace
  161. declaration.
  162. * **linefeed** [PSR-2]
  163. All PHP files must use the
  164. Unix LF (linefeed) line
  165. ending.
  166. * **lowercase_constants** [PSR-2]
  167. The PHP constants true, false,
  168. and null MUST be in lower
  169. case.
  170. * **lowercase_keywords** [PSR-2]
  171. PHP keywords MUST be in lower
  172. case.
  173. * **method_argument_space** [PSR-2]
  174. In method arguments and method
  175. call, there MUST NOT be a
  176. space before each comma and
  177. there MUST be one space after
  178. each comma.
  179. * **multiple_use** [PSR-2]
  180. There MUST be one use keyword
  181. per declaration.
  182. * **parenthesis** [PSR-2]
  183. There MUST NOT be a space
  184. after the opening parenthesis.
  185. There MUST NOT be a space
  186. before the closing
  187. parenthesis.
  188. * **php_closing_tag** [PSR-2]
  189. The closing ?> tag MUST be
  190. omitted from files containing
  191. only PHP.
  192. * **single_line_after_imports** [PSR-2]
  193. Each namespace use MUST go on
  194. its own line and there MUST be
  195. one blank line after the use
  196. statements block.
  197. * **switch_case_semicolon_to_colon** [PSR-2]
  198. A case should be followed by a
  199. colon and not a semicolon.
  200. * **switch_case_space** [PSR-2]
  201. Removes extra spaces between
  202. colon and case value.
  203. * **trailing_spaces** [PSR-2]
  204. Remove trailing whitespace at
  205. the end of non-blank lines.
  206. * **visibility** [PSR-2]
  207. Visibility MUST be declared on
  208. all properties and methods;
  209. abstract and final MUST be
  210. declared before the
  211. visibility; static MUST be
  212. declared after the visibility.
  213. * **array_element_no_space_before_comma** [symfony]
  214. In array declaration, there
  215. MUST NOT be a whitespace
  216. before each comma.
  217. * **array_element_white_space_after_comma** [symfony]
  218. In array declaration, there
  219. MUST be a whitespace after
  220. each comma.
  221. * **blankline_after_open_tag** [symfony]
  222. Ensure there is no code on the
  223. same line as the PHP open tag
  224. and it is followed by a
  225. blankline.
  226. * **concat_without_spaces** [symfony]
  227. Concatenation should be used
  228. without spaces.
  229. * **double_arrow_multiline_whitespaces** [symfony]
  230. Operator => should not be
  231. surrounded by multi-line
  232. whitespaces.
  233. * **duplicate_semicolon** [symfony]
  234. Remove duplicated semicolons.
  235. * **empty_return** [symfony]
  236. A return statement wishing to
  237. return nothing should be
  238. simply "return".
  239. * **extra_empty_lines** [symfony]
  240. Removes extra empty lines.
  241. * **function_typehint_space** [symfony]
  242. Add missing space between
  243. function's argument and its
  244. typehint.
  245. * **hash_to_slash_comment** [symfony]
  246. Single line comments should
  247. use double slashes (//) and
  248. not hash (#).
  249. * **heredoc_to_nowdoc** [symfony]
  250. Convert heredoc to nowdoc if
  251. possible.
  252. * **include** [symfony]
  253. Include/Require and file path
  254. should be divided with a
  255. single space. File path should
  256. not be placed under brackets.
  257. * **join_function** [symfony]
  258. Implode function should be
  259. used instead of join function.
  260. * **list_commas** [symfony]
  261. Remove trailing commas in list
  262. function calls.
  263. * **method_argument_default_value** [symfony]
  264. In method arguments there must
  265. not be arguments with default
  266. values before non-default
  267. ones.
  268. * **multiline_array_trailing_comma** [symfony]
  269. PHP multi-line arrays should
  270. have a trailing comma.
  271. * **namespace_no_leading_whitespace** [symfony]
  272. The namespace declaration line
  273. shouldn't contain leading
  274. whitespace.
  275. * **new_with_braces** [symfony]
  276. All instances created with new
  277. keyword must be followed by
  278. braces.
  279. * **no_blank_lines_after_class_opening** [symfony]
  280. There should be no empty lines
  281. after class opening brace.
  282. * **no_empty_lines_after_phpdocs** [symfony]
  283. There should not be blank
  284. lines between docblock and the
  285. documented element.
  286. * **object_operator** [symfony]
  287. There should not be space
  288. before or after object
  289. T_OBJECT_OPERATOR.
  290. * **operators_spaces** [symfony]
  291. Binary operators should be
  292. surrounded by at least one
  293. space.
  294. * **phpdoc_indent** [symfony]
  295. Docblocks should have the same
  296. indentation as the documented
  297. subject.
  298. * **phpdoc_inline_tag** [symfony]
  299. Fix PHPDoc inline tags, make
  300. inheritdoc always inline.
  301. * **phpdoc_no_access** [symfony]
  302. @access annotations should be
  303. omitted from phpdocs.
  304. * **phpdoc_no_empty_return** [symfony]
  305. @return void and @return null
  306. annotations should be omitted
  307. from phpdocs.
  308. * **phpdoc_no_package** [symfony]
  309. @package and @subpackage
  310. annotations should be omitted
  311. from phpdocs.
  312. * **phpdoc_params** [symfony]
  313. All items of the @param,
  314. @throws, @return, @var, and
  315. @type phpdoc tags must be
  316. aligned vertically.
  317. * **phpdoc_scalar** [symfony]
  318. Scalar types should always be
  319. written in the same form.
  320. "int", not "integer"; "bool",
  321. not "boolean"; "float", not
  322. "real" or "double".
  323. * **phpdoc_separation** [symfony]
  324. Annotations in phpdocs should
  325. be grouped together so that
  326. annotations of the same type
  327. immediately follow each other,
  328. and annotations of a different
  329. type are separated by a single
  330. blank line.
  331. * **phpdoc_short_description** [symfony]
  332. Phpdocs short descriptions
  333. should end in either a full
  334. stop, exclamation mark, or
  335. question mark.
  336. * **phpdoc_to_comment** [symfony]
  337. Docblocks should only be used
  338. on structural elements.
  339. * **phpdoc_trim** [symfony]
  340. Phpdocs should start and end
  341. with content, excluding the
  342. very first and last line of
  343. the docblocks.
  344. * **phpdoc_type_to_var** [symfony]
  345. @type should always be written
  346. as @var.
  347. * **phpdoc_types** [symfony]
  348. The correct case must be used
  349. for standard PHP types in
  350. phpdoc.
  351. * **phpdoc_var_without_name** [symfony]
  352. @var and @type annotations
  353. should not contain the
  354. variable name.
  355. * **pre_increment** [symfony]
  356. Pre
  357. incrementation/decrementation
  358. should be used if possible.
  359. * **print_to_echo** [symfony]
  360. Converts print language
  361. construct to echo if possible.
  362. * **remove_leading_slash_use** [symfony]
  363. Remove leading slashes in use
  364. clauses.
  365. * **remove_lines_between_uses** [symfony]
  366. Removes line breaks between
  367. use statements.
  368. * **return** [symfony]
  369. An empty line feed should
  370. precede a return statement.
  371. * **self_accessor** [symfony]
  372. Inside a classy element "self"
  373. should be preferred to the
  374. class name itself.
  375. * **short_bool_cast** [symfony]
  376. Short cast bool using double
  377. exclamation mark should not be
  378. used.
  379. * **single_array_no_trailing_comma** [symfony]
  380. PHP single-line arrays should
  381. not have trailing comma.
  382. * **single_blank_line_before_namespace** [symfony]
  383. There should be exactly one
  384. blank line before a namespace
  385. declaration.
  386. * **single_quote** [symfony]
  387. Convert double quotes to
  388. single quotes for simple
  389. strings.
  390. * **spaces_after_semicolon** [symfony]
  391. Fix whitespace after a
  392. semicolon.
  393. * **spaces_before_semicolon** [symfony]
  394. Single-line whitespace before
  395. closing semicolon are
  396. prohibited.
  397. * **spaces_cast** [symfony]
  398. A single space should be
  399. between cast and variable.
  400. * **standardize_not_equal** [symfony]
  401. Replace all <> with !=.
  402. * **ternary_spaces** [symfony]
  403. Standardize spaces around
  404. ternary operator.
  405. * **trim_array_spaces** [symfony]
  406. Arrays should be formatted
  407. like function/method
  408. arguments, without leading or
  409. trailing single line space.
  410. * **unalign_double_arrow** [symfony]
  411. Unalign double arrow symbols.
  412. * **unalign_equals** [symfony]
  413. Unalign equals symbols.
  414. * **unary_operators_spaces** [symfony]
  415. Unary operators should be
  416. placed adjacent to their
  417. operands.
  418. * **unneeded_control_parentheses** [symfony]
  419. Removes unneeded parentheses
  420. around control statements.
  421. * **unused_use** [symfony]
  422. Unused use statements must be
  423. removed.
  424. * **whitespacy_lines** [symfony]
  425. Remove trailing whitespace at
  426. the end of blank lines.
  427. * **align_double_arrow** [contrib]
  428. Align double arrow symbols in
  429. consecutive lines.
  430. * **align_equals** [contrib]
  431. Align equals symbols in
  432. consecutive lines.
  433. * **concat_with_spaces** [contrib]
  434. Concatenation should be used
  435. with at least one whitespace
  436. around.
  437. * **echo_to_print** [contrib]
  438. Converts echo language
  439. construct to print if
  440. possible.
  441. * **ereg_to_preg** [contrib]
  442. Replace deprecated ereg
  443. regular expression functions
  444. with preg. Warning! This could
  445. change code behavior.
  446. * **header_comment** [contrib]
  447. Add, replace or remove header
  448. comment.
  449. * **logical_not_operators_with_spaces** [contrib]
  450. Logical NOT operators (!)
  451. should have leading and
  452. trailing whitespaces.
  453. * **logical_not_operators_with_successor_space** [contrib]
  454. Logical NOT operators (!)
  455. should have one trailing
  456. whitespace.
  457. * **long_array_syntax** [contrib]
  458. Arrays should use the long
  459. syntax.
  460. * **multiline_spaces_before_semicolon** [contrib]
  461. Multi-line whitespace before
  462. closing semicolon are
  463. prohibited.
  464. * **native_function_casing** [contrib]
  465. Function defined by PHP should
  466. be called using the correct
  467. casing.
  468. * **newline_after_open_tag** [contrib]
  469. Ensure there is no code on the
  470. same line as the PHP open tag.
  471. * **no_blank_lines_before_namespace** [contrib]
  472. There should be no blank lines
  473. before a namespace
  474. declaration.
  475. * **ordered_use** [contrib]
  476. Ordering use statements.
  477. * **php4_constructor** [contrib]
  478. Convert PHP4-style
  479. constructors to __construct.
  480. Warning! This could change
  481. code behavior.
  482. * **php_unit_construct** [contrib]
  483. PHPUnit assertion method calls
  484. like "->assertSame(true,
  485. $foo)" should be written with
  486. dedicated method like
  487. "->assertTrue($foo)". Warning!
  488. This could change code
  489. behavior.
  490. * **php_unit_strict** [contrib]
  491. PHPUnit methods like
  492. "assertSame" should be used
  493. instead of "assertEquals".
  494. Warning! This could change
  495. code behavior.
  496. * **phpdoc_order** [contrib]
  497. Annotations in phpdocs should
  498. be ordered so that param
  499. annotations come first, then
  500. throws annotations, then
  501. return annotations.
  502. * **phpdoc_var_to_type** [contrib]
  503. @var should always be written
  504. as @type.
  505. * **short_array_syntax** [contrib]
  506. PHP arrays should use the PHP
  507. 5.4 short-syntax.
  508. * **short_echo_tag** [contrib]
  509. Replace short-echo <?= with
  510. long format <?php echo syntax.
  511. * **strict** [contrib]
  512. Comparison should be strict.
  513. Warning! This could change
  514. code behavior.
  515. * **strict_param** [contrib]
  516. Functions should be used with
  517. $strict param. Warning! This
  518. could change code behavior.
  519. The ``--config`` option customizes the files to analyse, based
  520. on some well-known directory structures:
  521. .. code-block:: bash
  522. # For the Symfony 2.3+ branch
  523. php php-cs-fixer.phar fix /path/to/sf23 --config=sf23
  524. Choose from the list of available configurations:
  525. * **default** A default configuration
  526. * **magento** The configuration for a Magento application
  527. * **sf23** The configuration for the Symfony 2.3+ branch
  528. The ``--dry-run`` option displays the files that need to be
  529. fixed but without actually modifying them:
  530. .. code-block:: bash
  531. php php-cs-fixer.phar fix /path/to/code --dry-run
  532. Instead of using command line options to customize the fixer, you can save the
  533. configuration in a ``.php_cs`` file in the root directory of
  534. your project. The file must return an instance of
  535. ``Symfony\CS\ConfigInterface``, which lets you configure the fixers, the level, the files,
  536. and directories that need to be analyzed. The example below will add two contrib fixers
  537. to the default list of symfony-level fixers:
  538. .. code-block:: php
  539. <?php
  540. $finder = Symfony\CS\Finder\DefaultFinder::create()
  541. ->exclude('somedir')
  542. ->in(__DIR__)
  543. ;
  544. return Symfony\CS\Config\Config::create()
  545. ->fixers(array('strict_param', 'short_array_syntax'))
  546. ->finder($finder)
  547. ;
  548. If you want complete control over which fixers you use, you may use the empty level and
  549. then specify all fixers to be used:
  550. .. code-block:: php
  551. <?php
  552. $finder = Symfony\CS\Finder\DefaultFinder::create()
  553. ->in(__DIR__)
  554. ;
  555. return Symfony\CS\Config\Config::create()
  556. ->level(Symfony\CS\FixerInterface::NONE_LEVEL)
  557. ->fixers(array('trailing_spaces', 'encoding'))
  558. ->finder($finder)
  559. ;
  560. You may also use a blacklist for the Fixers instead of the above shown whitelist approach.
  561. The following example shows how to use all ``symfony`` Fixers but the ``psr0`` fixer.
  562. Note the additional ``-`` in front of the Fixer name.
  563. .. code-block:: php
  564. <?php
  565. $finder = Symfony\CS\Finder\DefaultFinder::create()
  566. ->exclude('somedir')
  567. ->in(__DIR__)
  568. ;
  569. return Symfony\CS\Config\Config::create()
  570. ->fixers(array('-psr0'))
  571. ->finder($finder)
  572. ;
  573. The ``symfony`` level is set by default, you can also change the default level:
  574. .. code-block:: php
  575. <?php
  576. return Symfony\CS\Config\Config::create()
  577. ->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
  578. ;
  579. In combination with these config and command line options, you can choose various usage.
  580. For example, default level is ``symfony``, but if you also don't want to use
  581. the ``psr0`` fixer, you can specify the ``--fixers="-psr0"`` option.
  582. But if you use the ``--fixers`` option with only exact fixers,
  583. only those exact fixers are enabled whether or not level is set.
  584. With the ``--config-file`` option you can specify the path to the
  585. ``.php_cs`` file.
  586. Caching
  587. -------
  588. You can enable caching by returning a custom config with caching enabled. This will
  589. speed up further runs.
  590. .. code-block:: php
  591. <?php
  592. return Symfony\CS\Config\Config::create()
  593. ->setUsingCache(true)
  594. ;
  595. Exit codes
  596. ----------
  597. * 0 OK
  598. * 1 No changes made
  599. * 16 Configuration error of the application
  600. * 32 Configuration error of a Fixer
  601. Helpers
  602. -------
  603. Dedicated plugins exist for:
  604. * `Atom`_
  605. * `NetBeans`_
  606. * `PhpStorm`_
  607. * `Sublime Text`_
  608. * `Vim`_
  609. Contribute
  610. ----------
  611. The tool comes with quite a few built-in fixers and finders, but everyone is
  612. more than welcome to `contribute`_ more of them.
  613. Fixers
  614. ~~~~~~
  615. A *fixer* is a class that tries to fix one CS issue (a ``Fixer`` class must
  616. implement ``FixerInterface``).
  617. Configs
  618. ~~~~~~~
  619. A *config* knows about the CS level and the files and directories that must be
  620. scanned by the tool when run in the directory of your project. It is useful for
  621. projects that follow a well-known directory structures (like for Symfony
  622. projects for instance).
  623. .. _php-cs-fixer.phar: http://get.sensiolabs.org/php-cs-fixer.phar
  624. .. _Atom: https://github.com/Glavin001/atom-beautify
  625. .. _NetBeans: http://plugins.netbeans.org/plugin/49042/php-cs-fixer
  626. .. _PhpStorm: http://tzfrs.de/2015/01/automatically-format-code-to-match-psr-standards-with-phpstorm
  627. .. _Sublime Text: https://github.com/benmatselby/sublime-phpcs
  628. .. _Vim: https://github.com/stephpy/vim-php-cs-fixer
  629. .. _contribute: https://github.com/FriendsOfPhp/php-cs-fixer/blob/master/CONTRIBUTING.md