Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit 7a9a2c7

Browse files
committed
Update Docs | added refinery29 to credits | added styleci file and some docs about it | removed not needed docs and settings
1 parent b454384 commit 7a9a2c7

File tree

8 files changed

+154
-37
lines changed

8 files changed

+154
-37
lines changed

.gitattributes

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
/bin export-ignore
22
/test export-ignore
3-
/.codeclimate.yml export-ignore
43
/.gitattributes export-ignore
54
/.gitignore export-ignore
65
/.php_cs export-ignore
76
/.travis.yml export-ignore
8-
/Makefile export-ignore
9-
/phpunit.xml export-ignore
7+
/.styleci.yml export-ignore
8+
/phpunit.xml export-ignore

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
build/
21
vendor/
32
.php_cs.cache

.php_cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ $config->getFinder()
77
->in(__DIR__)
88
->exclude('build')
99
->exclude('vendor')
10-
->notName('CONTRIBUTING')
10+
->exclude('tests')
11+
->name('*.php')
1112
->ignoreDotFiles(true)
1213
->ignoreVCS(true);
1314

1415
$cacheDir = getenv('TRAVIS') ? getenv('HOME') . '/.php-cs-fixer' : __DIR__;
1516

1617
$config->setCacheFile($cacheDir . '/.php_cs.cache');
1718

18-
1919
return $config;

.styleci.yml

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,66 @@
1-
preset: psr2
1+
preset: psr2
2+
3+
risky: false
4+
5+
linting: true
6+
7+
enabled:
8+
- concat_with_spaces
9+
- function_typehint_space
10+
- newline_after_open_tag
11+
- no_blank_lines_before_namespace
12+
- ordered_use
13+
- phpdoc_order
14+
- short_array_syntax
15+
- alias_functions
16+
- array_element_no_space_before_comma
17+
- array_element_white_space_after_comma
18+
- double_arrow_multiline_whitespaces
19+
- duplicate_semicolon
20+
- empty_return
21+
- extra_empty_lines
22+
- include
23+
- list_commas
24+
- method_separation
25+
- multiline_array_trailing_comma
26+
- namespace_no_leading_whitespace
27+
- new_with_braces
28+
- no_blank_lines_after_class_opening
29+
- no_empty_lines_after_phpdocs
30+
- object_operator
31+
- operators_spaces
32+
- phpdoc_align
33+
- phpdoc_indent
34+
- phpdoc_inline_tag
35+
- phpdoc_no_access
36+
- phpdoc_no_empty_return
37+
- phpdoc_no_package
38+
- phpdoc_scalar
39+
- phpdoc_separation
40+
- phpdoc_to_comment
41+
- phpdoc_trim
42+
- phpdoc_types
43+
- phpdoc_type_to_var
44+
- phpdoc_var_without_name
45+
- remove_leading_slash_use
46+
- remove_lines_between_uses
47+
- return
48+
- short_bool_cast
49+
- single_array_no_trailing_comma
50+
- single_quote
51+
- spaces_after_semicolon
52+
- spaces_before_semicolon
53+
- spaces_cast
54+
- standardize_not_equal
55+
- ternary_spaces
56+
- trim_array_spaces
57+
- unneeded_control_parentheses
58+
- whitespacy_lines
59+
60+
finder:
61+
exclude:
62+
- "build"
63+
- "vendor"
64+
- "tests"
65+
name:
66+
- "*.php"

.travis.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ php:
88
- nightly
99

1010
matrix:
11-
include:
12-
- php: 5.6
13-
env: CHECK_CS=true
14-
- php: 7.0
1511
allow_failures:
1612
- php: nightly
1713
fast_finish: true
@@ -29,13 +25,12 @@ install:
2925
- composer install --prefer-dist
3026

3127
before_script:
32-
- if [[ "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_BRANCH" == "master" ]]; then IS_MERGE_TO_MASTER=true; fi
3328
- mkdir -p "$HOME/.php-cs-fixer"
3429

3530
script:
3631
- mkdir -p build/logs
37-
- if [[ "$IS_MERGE_TO_MASTER" == "true" ]]; then vendor/bin/phpunit -c phpunit.xml.dist --verbose; fi
38-
- if [[ "$CHECK_CS" == "true" ]]; then vendor/bin/php-cs-fixer fix --config-file=.php_cs --verbose --diff --dry-run; fi
32+
- then vendor/bin/phpunit -c phpunit.xml.dist --verbose; fi
33+
- vendor/bin/php-cs-fixer fix --config-file=.php_cs --verbose --diff --dry-run
3934

4035
after_script:
4136
- wget https://scrutinizer-ci.com/ocular.phar

README.md

Lines changed: 74 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ we use to verify and enforce a single coding standard for PHP code within Narrow
1818
Via Composer
1919

2020
``` bash
21-
$ composer require --dev "fabpot/php-cs-fixer:2.0.*@dev"
2221
$ composer require narrowspark/php-cs-fixer-config
2322
```
2423

@@ -36,7 +35,8 @@ $config->getFinder()
3635
->in(__DIR__)
3736
->exclude('build')
3837
->exclude('vendor')
39-
->notName('CONTRIBUTING')
38+
->exclude('tests')
39+
->name('*.php')
4040
->ignoreDotFiles(true)
4141
->ignoreVCS(true);
4242

@@ -74,18 +74,77 @@ script:
7474
- vendor/bin/php-cs-fixer fix --config-file=.php_cs --verbose --diff --dry-run
7575
```
7676

77-
If you only want to run `php-cs-fixer` on one PHP version, update your build matrix and use a condition:
78-
79-
```yml
80-
matrix:
81-
include:
82-
- php: 5.6
83-
env: CHECK_CS=true
84-
- php: 7.0
85-
86-
script:
87-
- if [[ "$CHECK_CS" == "true" ]]; then vendor/bin/php-cs-fixer fix --config-file=.php_cs --verbose --diff --dry-run; fi
88-
```
77+
### StyleCi
78+
If you using (StyleCi)[https://styleci.io] just copy (.styleci.yml)[.styleci.yml] to you repository and enable styleci. Or copy this setting to StyleCi
79+
80+
~~~yml
81+
preset: psr2
82+
83+
risky: false
84+
85+
linting: true
86+
87+
enabled:
88+
- concat_with_spaces
89+
- function_typehint_space
90+
- newline_after_open_tag
91+
- no_blank_lines_before_namespace
92+
- ordered_use
93+
- phpdoc_order
94+
- short_array_syntax
95+
- alias_functions
96+
- array_element_no_space_before_comma
97+
- array_element_white_space_after_comma
98+
- double_arrow_multiline_whitespaces
99+
- duplicate_semicolon
100+
- empty_return
101+
- extra_empty_lines
102+
- include
103+
- list_commas
104+
- method_separation
105+
- multiline_array_trailing_comma
106+
- namespace_no_leading_whitespace
107+
- new_with_braces
108+
- no_blank_lines_after_class_opening
109+
- no_empty_lines_after_phpdocs
110+
- object_operator
111+
- operators_spaces
112+
- phpdoc_align
113+
- phpdoc_indent
114+
- phpdoc_inline_tag
115+
- phpdoc_no_access
116+
- phpdoc_no_empty_return
117+
- phpdoc_no_package
118+
- phpdoc_scalar
119+
- phpdoc_separation
120+
- phpdoc_to_comment
121+
- phpdoc_trim
122+
- phpdoc_types
123+
- phpdoc_type_to_var
124+
- phpdoc_var_without_name
125+
- remove_leading_slash_use
126+
- remove_lines_between_uses
127+
- return
128+
- short_bool_cast
129+
- single_array_no_trailing_comma
130+
- single_quote
131+
- spaces_after_semicolon
132+
- spaces_before_semicolon
133+
- spaces_cast
134+
- standardize_not_equal
135+
- ternary_spaces
136+
- trim_array_spaces
137+
- unneeded_control_parentheses
138+
- whitespacy_lines
139+
140+
finder:
141+
exclude:
142+
- "build"
143+
- "vendor"
144+
- "tests"
145+
name:
146+
- "*.php"
147+
~~~
89148

90149
## Change log
91150

@@ -103,7 +162,7 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
103162

104163
## Credits
105164

106-
- [Daniel Bannert](https://github.com/prisis)
165+
- [refinery29](https://github.com/refinery29/php-cs-fixer-config)
107166
- [All Contributors](../../contributors)
108167

109168
## License

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@
2424
}
2525
],
2626
"require": {
27-
"php" : ">=5.6",
28-
"fabpot/php-cs-fixer" : "2.0.x-dev"
27+
"php" : ">=5.6",
28+
"fabpot/php-cs-fixer" : "2.0.x-dev"
2929
},
3030
"require-dev": {
31-
"phpunit/phpunit" : "~5.1.3"
31+
"phpunit/phpunit" : "~5.1.3"
3232
},
3333
"autoload": {
3434
"psr-4": {
35-
"Narrowspark\\CS\\Config\\" : "src"
35+
"Narrowspark\\CS\\Config\\" : "src"
3636
}
3737
},
3838
"autoload-dev": {
3939
"psr-4": {
40-
"Narrowspark\\CS\\Config\\Test\\": "test"
40+
"Narrowspark\\CS\\Config\\Test\\" : "test"
4141
}
4242
},
43-
"minimum-stability" : "dev",
44-
"prefer-stable" : true
43+
"minimum-stability" : "dev",
44+
"prefer-stable" : true
4545
}

src/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ private function getSymfonyRules()
135135
'unalign_double_arrow' => false,
136136
'unalign_equals' => false,
137137
'unneeded_control_parentheses' => true,
138-
'unused_use' => true,
138+
'unused_use' => false,
139139
'whitespacy_lines' => true,
140140
];
141141
}

0 commit comments

Comments
 (0)