New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CS] Update config for php-cs-fixer v2.0 and remove StyleCI config/badge #992
Changes from 4 commits
71a58db
1834377
a71818e
7f919e9
d922d94
eccadb8
2d64fb4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
$header = <<<'EOF' | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This blank line needs to be removed, and the spaces before the other header lines need to be removed, as well. It should be: $header = <<<'EOF'
This file is part of the `liip/LiipImagineBundle` project.
(c) https://github.com/liip/LiipImagineBundle/graphs/contributors
For the full copyright and license information, please view the LICENSE.md
file that was distributed with this source code.
EOF; |
||
This file is part of the `liip/LiipImagineBundle` project. | ||
|
||
(c) https://github.com/liip/LiipImagineBundle/graphs/contributors | ||
|
||
For the full copyright and license information, please view the LICENSE.md | ||
file that was distributed with this source code. | ||
EOF; | ||
|
||
$config = PhpCsFixer\Config::create() | ||
->setRiskyAllowed(true) | ||
->setRules([ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to obey the cs rules defined here, in this file, itself. :-) Change to long array syntax here, and elsewhere in the file where short array syntax is used. |
||
//'@PHP56Migration' => true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we get rid of all commented entries? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, I leave it just in case that you want enable someone of them, that actually could be good for the project. I will remove all commented |
||
'@Symfony' => true, | ||
//'@Symfony:risky' => true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this enable? Do we possibly want to do so? We generally strictly follow Symfony's coding standings, short of long array syntax and a few other small differences. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is commented, just in case that you or someone want enable to experiment. The risky enable more agressive fixes, that not in all cases could be perfect. According to doc "Risky rule is a rule, which could change code behaviour. By default no risky rules are run." |
||
//'align_multiline_comment' => true, | ||
'array_syntax' => ['syntax' => 'long'], | ||
//'blank_line_before_statement' => true, | ||
'combine_consecutive_unsets' => true, | ||
'linebreak_after_opening_tag' => true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just corrected it through the web interface |
||
// one should use PHPUnit methods to set up expected exception instead of annotations | ||
//'general_phpdoc_annotation_remove' => ['annotations' => ['expectedException', 'expectedExceptionMessage', 'expectedExceptionMessageRegExp']], | ||
'header_comment' => ['header' => $header], | ||
//'heredoc_to_nowdoc' => true, | ||
'list_syntax' => ['syntax' => 'long'], | ||
//'method_argument_space' => ['ensure_fully_multiline' => true], | ||
//'no_extra_consecutive_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']], | ||
//'no_null_property_initialization' => true, | ||
'no_short_echo_tag' => true, | ||
//'no_superfluous_elseif' => true, | ||
//'no_unneeded_curly_braces' => true, | ||
//'no_unneeded_final_method' => true, | ||
//'no_unreachable_default_argument_value' => true, | ||
//'no_useless_else' => true, | ||
//'no_useless_return' => true, | ||
//'ordered_class_elements' => true, | ||
'ordered_imports' => true, | ||
'php_unit_construct' => true, | ||
'php_unit_dedicate_assert' => true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indentation error. |
||
//'php_unit_strict' => true, | ||
//'php_unit_test_class_requires_covers' => true, | ||
//'phpdoc_add_missing_param_annotation' => true, | ||
'phpdoc_order' => true, | ||
//'phpdoc_types_order' => true, | ||
//'semicolon_after_instruction' => true, | ||
//'single_line_comment_style' => true, | ||
//'strict_comparison' => true, | ||
//'strict_param' => true, | ||
]) | ||
->setFinder( | ||
PhpCsFixer\Finder::create() | ||
->name("*.php") | ||
->name("*.twig") | ||
->exclude('vendor/var') | ||
->in(__DIR__) | ||
) | ||
; |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a newline after the opening
<?php
and add our copyright, making it: