@@ -5,14 +5,14 @@ anchor: code_style_guide
5
5
# Code Style Guide {#code_style_guide_title}
6
6
7
7
The PHP community is large and diverse, composed of innumerable libraries, frameworks, and components. It is common for
8
- PHP developers to choose several of these and combine them into a single project. It is important that PHP code adhere
8
+ PHP developers to choose several of these and combine them into a single project. It is important that PHP code adheres
9
9
(as close as possible) to a common code style to make it easy for developers to mix and match various libraries for
10
10
their projects.
11
11
12
- The [ Framework Interop Group] [ fig ] has proposed and approved a series of style recommendations. Not all of them related
12
+ The [ Framework Interop Group] [ fig ] has proposed and approved a series of style recommendations. Not all of them relate
13
13
to code-style, but those that do are [ PSR-1] [ psr1 ] , [ PSR-12] [ psr12 ] and [ PSR-4] [ psr4 ] . These
14
14
recommendations are merely a set of rules that many projects like Drupal, Zend, Symfony, Laravel, CakePHP, phpBB, AWS SDK,
15
- FuelPHP, Lithium, etc are adopting. You can use them for your own projects, or continue to use your own
15
+ FuelPHP, Lithium, etc. are adopting. You can use them for your own projects, or continue to use your own
16
16
personal style.
17
17
18
18
Ideally, you should write PHP code that adheres to a known standard. This could be any combination of PSRs, or one
@@ -48,7 +48,7 @@ If you have PHP_CodeSniffer, then you can fix the code layout problems reported
48
48
phpcbf -w --standard=PSR1 file.php
49
49
50
50
Another option is to use the [ PHP Coding Standards Fixer] [ phpcsfixer ] .
51
- It will show which kind of errors the code structure had before it fixed them.
51
+ It will show what kind of errors the code structure had before it fixed them.
52
52
53
53
php-cs-fixer fix -v --rules=@PSR1 file.php
54
54
0 commit comments