Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
c0ca29b0
Unverified
Commit
c0ca29b0
authored
Jul 10, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update php-cs-fixer configuration file to use v2
parent
5ab4aea1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
33 deletions
+32
-33
.php_cs.dist
.php_cs.dist
+32
-33
No files found.
.php_cs
→
.php_cs
.dist
View file @
c0ca29b0
<?php
$finder
=
Symfony\CS\Finder\DefaultFinder
::
create
()
->
exclude
(
'public'
)
->
exclude
(
'vendor'
)
->
exclude
(
'storage'
)
->
exclude
(
'app'
)
->
exclude
(
'bootstrap'
)
->
exclude
(
'tests'
)
->
notPath
(
'server.php'
)
$finder
=
PhpCsFixer\Finder
::
create
()
->
in
(
__DIR__
)
->
exclude
([
'public'
,
'vendor'
,
'storage'
,
'app'
,
'bootstrap'
,
'tests'
,
'node_modules'
,
])
->
notPath
(
'server.php'
)
;
return
Symfony\CS\Config
\Config
::
create
()
->
set
UsingCache
(
true
)
->
level
(
Symfony\CS\FixerInterface
::
PSR2_LEVEL
)
->
fixers
(
array
(
return
PhpCsFixer
\Config
::
create
()
->
set
Finder
(
$finder
)
->
setRules
([
'@PSR2'
=>
true
,
// Concatenation should be used with at least one whitespace around.
'concat_
with_spaces'
,
'concat_
space'
=>
[
'spacing'
=>
'one'
]
,
// Unused use statements must be removed.
'ordered_
use'
,
'ordered_
imports'
=>
true
,
// Removes extra empty lines.
'extra_empty_lines'
,
// Removes line breaks between use statements.
'remove_lines_between_uses'
,
'no_extra_consecutive_blank_lines'
=>
true
,
// An empty line feed should precede a return statement.
'
return'
,
'
blank_line_before_return'
=>
true
,
// Unused use statements must be removed.
'
unused_use'
,
'
no_unused_imports'
=>
true
,
// Remove trailing whitespace at the end of blank lines.
'
whitespacy_lines'
,
'
no_whitespace_in_blank_line'
=>
true
,
// There MUST be one blank line after the namespace declaration.
'
line_after_namespace'
,
'
blank_line_after_namespace'
=>
true
,
// There should be exactly one blank line before a namespace declaration.
'single_blank_line_before_namespace'
,
'single_blank_line_before_namespace'
=>
true
,
// Each namespace use MUST go on its own line and there MUST be one blank line after the use statements block.
'single_line_after_imports'
,
'single_line_after_imports'
=>
true
,
// Ensure there is no code on the same line as the PHP open tag and it is followed by a blankline.
'blank
line_after_open_tag'
,
'blank
_line_after_opening_tag'
=>
true
,
// Remove duplicated semicolons.
'
duplicate_semicolon'
,
'
no_empty_statement'
=>
true
,
// PHP multi-line arrays should have a trailing comma.
'
multiline_array_trailing_comma'
,
'
trailing_comma_in_multiline_array'
=>
true
,
// There should be no empty lines after class opening brace.
'no_blank_lines_after_class_opening'
,
'no_blank_lines_after_class_opening'
=>
true
,
// There should not be blank lines between docblock and the documented element.
'no_
empty_lines_after_phpdocs'
,
'no_
blank_lines_after_phpdoc'
=>
true
,
// Phpdocs should start and end with content, excluding the very first and last line of the docblocks.
'phpdoc_trim'
,
// Removes line breaks between use statements.
'remove_lines_between_uses'
,
))
->
finder
(
$finder
);
'phpdoc_trim'
=>
true
,
])
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment