Skip to content
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

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
59 changes: 59 additions & 0 deletions .php_cs
@@ -0,0 +1,59 @@
<?php
Copy link
Collaborator

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:

<?php

/*
 * 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.
 */

$header = <<<'EOF'

$header = <<<'EOF'

Copy link
Collaborator

Choose a reason for hiding this comment

The 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([
Copy link
Collaborator

Choose a reason for hiding this comment

The 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,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get rid of all commented entries?

Copy link
Author

Choose a reason for hiding this comment

The 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,
Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

Copy link
Author

Choose a reason for hiding this comment

The 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,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line (18), as well as line 22, 23, and 24 are indented using \t (tab) characters. Please ensure the whole document is written out using spaces.

Copy link
Collaborator

Choose a reason for hiding this comment

The 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,
Copy link
Collaborator

Choose a reason for hiding this comment

The 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__)
)
;
32 changes: 0 additions & 32 deletions .php_cs.dist

This file was deleted.

20 changes: 0 additions & 20 deletions .styleci.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
@@ -1,8 +1,8 @@
# LiipImagineBundle

| Travis-CI | Style-CI | Coverage | Downloads | Release |
|:----------------------:|:-----------------------:|:-----------------------:|:-----------------------:|:-----------------------:|
| [![Travis](https://src.run/shield/liip/LiipImagineBundle/1.0/travis.svg)](https://src.run/service/liip/LiipImagineBundle/1.0/travis) | [![Style CI](https://src.run/shield/liip/LiipImagineBundle/1.0/styleci.svg)](https://src.run/service/liip/LiipImagineBundle/1.0/styleci) | [![Coverage](https://src.run/shield/liip/LiipImagineBundle/1.0/coveralls.svg)](https://src.run/service/liip/LiipImagineBundle/1.0/coveralls) | [![Downloads](https://src.run/shield/liip/LiipImagineBundle/packagist_dt.svg)](https://src.run/service/liip/LiipImagineBundle/packagist) | [![Latest Stable Version](https://src.run/shield/liip/LiipImagineBundle/packagist_v.svg)](https://src.run/service/liip/LiipImagineBundle/packagist) |
| Travis-CI | Coverage | Downloads | Release |
|:----------------------:|:-----------------------:|:-----------------------:|:-----------------------:|
| [![Travis](https://src.run/shield/liip/LiipImagineBundle/1.0/travis.svg)](https://src.run/service/liip/LiipImagineBundle/1.0/travis) | [![Coverage](https://src.run/shield/liip/LiipImagineBundle/1.0/coveralls.svg)](https://src.run/service/liip/LiipImagineBundle/1.0/coveralls) | [![Downloads](https://src.run/shield/liip/LiipImagineBundle/packagist_dt.svg)](https://src.run/service/liip/LiipImagineBundle/packagist) | [![Latest Stable Version](https://src.run/shield/liip/LiipImagineBundle/packagist_v.svg)](https://src.run/service/liip/LiipImagineBundle/packagist) |

*This bundle provides an image manipulation abstraction toolkit for [Symfony](http://symfony.com/)-based projects.*

Expand Down