-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* php cs
- Loading branch information
Showing
17 changed files
with
149 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,6 @@ vendor | |
/.idea | ||
/.idea/* | ||
.travis.yml | ||
|
||
.php_cs.cache | ||
.phpunit.result.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
|
||
require_once __DIR__ . '/vendor/autoload.php'; | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in(__DIR__ . '/Annotation') | ||
->in(__DIR__ . '/Builder') | ||
->in(__DIR__ . '/CacheWarmer') | ||
->in(__DIR__ . '/DependencyInjection') | ||
->in(__DIR__ . '/Dumper') | ||
->in(__DIR__ . '/Loader') | ||
->in(__DIR__ . '/SecurityPolicy') | ||
->in(__DIR__ . '/Validator') | ||
->in(__DIR__ . '/tests'); | ||
|
||
$rules = [ | ||
'@Symfony' => true, | ||
'@Symfony:risky' => true, | ||
|
||
// exceptions | ||
'single_line_throw' => false, | ||
|
||
// php file | ||
'concat_space' => ['spacing' => 'one'], | ||
|
||
// namespace and imports | ||
'global_namespace_import' => [ | ||
'import_classes' => false, | ||
'import_constants' => false, | ||
'import_functions' => false, | ||
], | ||
|
||
// standard functions and operators | ||
'native_constant_invocation' => false, | ||
'native_function_invocation' => false, | ||
|
||
// functions, methods | ||
'void_return' => true, | ||
|
||
// operators | ||
// multiline operators must always be at the beginning of the line | ||
'operator_linebreak' => [ | ||
'only_booleans' => true, | ||
'position' => 'beginning', | ||
], | ||
// Use null coalescing operator ?? where possible | ||
'ternary_to_null_coalescing' => true, | ||
'list_syntax' => ['syntax' => 'short'], | ||
|
||
// phpdoc | ||
'phpdoc_annotation_without_dot' => false, | ||
'phpdoc_summary' => false, | ||
|
||
// phpunit | ||
'php_unit_test_case_static_method_calls' => ['call_type' => 'this'], | ||
|
||
// semicolon | ||
// move the semicolon to the new line for chained calls | ||
'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'], | ||
|
||
'visibility_required' => ['elements' => ['property', 'method']], | ||
]; | ||
|
||
return (new \PhpCsFixer\Config()) | ||
->setFinder($finder) | ||
->setCacheFile(__DIR__ . '/.php_cs.cache') | ||
->setRiskyAllowed(true) | ||
->setRules($rules) | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.