File tree Expand file tree Collapse file tree 2 files changed +11
-20
lines changed Expand file tree Collapse file tree 2 files changed +11
-20
lines changed Original file line number Diff line number Diff line change 2
2
3
3
[ ![ CircleCI] ( https://circleci.com/gh/VincentLanglet/Symfony3-custom-coding-standard.svg?style=svg&circle-token=04bcfbcceb34f9644561c0a9ef27e935ff467705 )] ( https://circleci.com/gh/VincentLanglet/Symfony3-custom-coding-standard )
4
4
5
+ Customized coding standards for Symfony3 projects.
6
+ Can be used for Symfony2 projects too.
7
+
5
8
Documentation
6
9
-------------
7
10
* [ Coding Standard] ( docs/standards.md )
Original file line number Diff line number Diff line change 2
2
3
3
This standard can be installed with the [ Composer] ( https://getcomposer.org/ ) dependency manager.
4
4
5
- 1 . Add the repository to your composer.json:
5
+ 1 . Add the coding standard as a dependency of your project
6
6
7
- ``` json
8
- "repositories" : [
9
- {
10
- "type" : " vcs" ,
11
- "url" : " git@github.com:VincentLanglet/Symfony3-custom-coding-standard"
12
- }
13
- ]
14
7
```
15
-
16
- 2 . Add the coding standard as a dependency of your project
17
-
18
- ``` json
19
- "require-dev" : {
20
- "vincentlanglet/symfony3-custom-coding-standard" : " ^2.18"
21
- },
8
+ composer require --dev vincentlanglet/symfony3-custom-coding-standard
22
9
```
23
10
24
- 3 . Add the coding standard to the PHP_CodeSniffer install path
11
+ 2 . Add the coding standard to the PHP_CodeSniffer install path
25
12
26
- The path is relative to the php_codesniffer install path. This is important to make it work both in your vagrant, local machine and PHPStorm
13
+ The path is relative to the php_codesniffer install path.
14
+ This is important to make it work both in your vagrant, local machine and PHPStorm
27
15
28
16
```
29
17
bin/phpcs --config-set installed_paths ../../vincentlanglet/symfony3-custom-coding-standard
30
18
```
31
19
32
- 4 . Check the installed coding standards
20
+ 3 . Check the installed coding standards
33
21
34
22
```
35
23
bin/phpcs -i
36
24
```
37
25
38
- 5 . Done!
26
+ 4 . Done!
39
27
40
28
```
41
29
bin/phpcs --standard=Symfony3Custom /path/to/code
42
30
```
43
31
44
- 6 . (optional) Set up PHPStorm
32
+ 5 . (optional) Set up PHPStorm
45
33
46
34
- configure code sniffer under Languages & Frameworks -> PHP -> Code Sniffer
47
35
- Go to Editor -> Inspections -> PHP Code sniffer, refresh the standards and select Symfony3Custom
You can’t perform that action at this time.
0 commit comments