Skip to content

Commit bc0b3e8

Browse files
committed
updated fabpot/php-cs-fixer
1 parent 4e38e68 commit bc0b3e8

File tree

4 files changed

+57
-4
lines changed

4 files changed

+57
-4
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
.php_cs.cache
12
build
23
composer.lock
34
docs
4-
vendor
5+
vendor

.php_cs

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
3+
$finder = Symfony\CS\Finder\DefaultFinder::create()
4+
->exclude('files')
5+
->exclude('vendor')
6+
->in(__DIR__);
7+
8+
return Symfony\CS\Config\Config::create()
9+
->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
10+
->fixers([
11+
/**
12+
* symfony
13+
*/
14+
// Ensure there is no code on the same line as the PHP open tag and it is followed by a blankline.
15+
'blankline_after_open_tag',
16+
// Remove duplicated semicolons.
17+
'duplicate_semicolon',
18+
// Removes extra empty lines.
19+
'extra_empty_lines',
20+
// PHP multi-line arrays should have a trailing comma.
21+
'multiline_array_trailing_comma',
22+
// There should be no empty lines after class opening brace.
23+
'no_blank_lines_after_class_opening',
24+
// There should not be blank lines between docblock and the documented element.
25+
'no_empty_lines_after_phpdocs',
26+
// Phpdocs short descriptions should end in either a full stop, exclamation mark, or question mark.
27+
'phpdoc_short_description',
28+
// Phpdocs should start and end with content, excluding the very first and last line of the docblocks.
29+
'phpdoc_trim',
30+
// Removes line breaks between use statements.
31+
'remove_lines_between_uses',
32+
// An empty line feed should precede a return statement.
33+
'return',
34+
// There should be exactly one blank line before a namespace declaration.
35+
'single_blank_line_before_namespace',
36+
// Convert double quotes to single quotes for simple strings.
37+
'single_quote',
38+
// Unused use statements must be removed.
39+
'unused_use',
40+
41+
/**
42+
* contrib
43+
*/
44+
// Concatenation should be used with at least one whitespace around.
45+
'concat_with_spaces',
46+
// Ensure there is no code on the same line as the PHP open tag.
47+
'newline_after_open_tag',
48+
// Ordering use statements.
49+
'ordered_use',
50+
])
51+
->setUsingCache(true)
52+
->finder($finder);

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"require-dev": {
2222
"phpunit/phpunit": "4.*",
2323
"adamwathan/faktory": "0.3.*",
24-
"fabpot/php-cs-fixer": "1.0.*@dev",
24+
"fabpot/php-cs-fixer": "^1.11",
2525
"orchestra/testbench": "~3.0"
2626
},
2727
"autoload": {

readme.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ __Note:__ These examples use the [laravelcollective/html](http://laravelcollecti
7979

8080

8181
## Contributing?
82-
Please format your code before creating a pull-request:
82+
Please format your code before creating a pull-request. This will format all files as specified in `.php_cs`:
8383

84-
vendor/bin/php-cs-fixer fix --level psr2 .
84+
vendor/bin/php-cs-fixer fix .
8585

8686
## Security
8787

0 commit comments

Comments
 (0)