You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.rst
+16-9Lines changed: 16 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,13 @@ If you are already using a linter to identify coding standards problems in your
7
7
code, you know that fixing them by hand is tedious, especially on large
8
8
projects. This tool not only detects them, but also fixes them for you.
9
9
10
-
PHP CS Fixer has built-in rule sets, whether you want to follow PHP coding standards as defined by `PHP-FIG's PER Coding Style <https://www.php-fig.org/per/coding-style/>`__,
11
-
a wide community like the `Symfony <https://symfony.com/doc/current/contributing/code/standards.html>`__,
12
-
or `our opinionated one <./doc/ruleSets/PhpCsFixer.rst>`__.
10
+
PHP CS Fixer has built-in rule sets, whether you want to follow PHP coding standards as defined by `PHP-FIG's PER Coding Style <https://www.php-fig.org/per/coding-style/>`__ - `@PER-CS <./doc/ruleSets/PER-CS.rst>`__,
11
+
a wide community like the `Symfony <https://symfony.com/doc/current/contributing/code/standards.html>`__ - `@Symfony <./doc/ruleSets/Symfony.rst>`__,
12
+
or our opinionated one - `@PhpCsFixer<./doc/ruleSets/PhpCsFixer.rst>`__.
13
13
You can also define your (team's) style through the `configuration file <./doc/config.rst>`__.
14
14
15
-
PHP CS Fixer can not only unify the style of your code, but also help to modernize your codebase towards
PHP CS Fixer can not only unify the style of your code, but also help to modernise your codebase towards
16
+
newer PHP (e.g. `@autoPHPMigration <./doc/ruleSets/AutoPHPMigration.rst>`__ and `@autoPHPMigration:risky <./doc/ruleSets/AutoPHPMigrationRisky.rst>`__) and newer PHPUnit (e.g. `@autoPHPUnitMigration:risky <./doc/ruleSets/AutoPHPUnitMigrationRisky.rst>`__).
17
17
18
18
Supported PHP Versions
19
19
----------------------
@@ -41,17 +41,24 @@ For more details and other installation methods (also with Docker or behind CI),
41
41
Usage
42
42
~~~~~
43
43
44
-
Assuming you installed PHP CS Fixer as instructed above, you can run
45
-
the following command to fix the files PHP files in the ``src`` directory:
44
+
Assuming you installed PHP CS Fixer as instructed above, you can
45
+
initialise base config for your project by using following command:
46
46
47
47
.. code:: sh
48
48
49
-
$ ./vendor/bin/php-cs-fixer fix src
49
+
$ ./vendor/bin/php-cs-fixer init
50
+
51
+
To automatically fix your project, or only check against the need of changes, run:
52
+
53
+
.. code:: sh
54
+
55
+
$ ./vendor/bin/php-cs-fixer fix
56
+
$ ./vendor/bin/php-cs-fixer check
50
57
51
58
See `usage <./doc/usage.rst>`__, list of `built-in rules <./doc/rules/index.rst>`__, list of `rule sets <./doc/ruleSets/index.rst>`__ and `configuration file <./doc/config.rst>`__ documentation for more
52
59
details.
53
60
54
-
If you need to apply code styles that are not supported by the tool, you can `create custom rules <./doc/custom_rules.rst>`__.
61
+
If you need to apply code styles that are not built-in into the tool, you can `create custom rules <./doc/custom_rules.rst>`__.
0 commit comments