Skip to content

Commit

Permalink
Merge pull request #22 from Daric971/feature_phpcs
Browse files Browse the repository at this point in the history
Fix deprecated PHP-CS rules
  • Loading branch information
mremi authored Aug 13, 2021
2 parents 82cbb22 + 92096e9 commit e842c4c
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 66 deletions.
72 changes: 72 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

/**
* This file is part of the ekino/phpstan-sonata project.
*
* (c) Ekino
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

$header = <<<EOF
This file is part of the ekino/phpstan-sonata project.
(c) Ekino
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF;

$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->in(['src','tests'])
;

$config = new PhpCsFixer\Config();

$config->setUsingCache(true)
->setRiskyAllowed(true)
->setFinder($finder);

return $config->setRules([
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => ['default' => 'single_space', 'operators' => ['=>' => 'align_single_space', '=' => 'align_single_space']],
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'declare_strict_types' => true,
'header_comment' => ['header' => $header],
'indentation_type' => true,
'linebreak_after_opening_tag' => true,
'constant_case' => true,
'lowercase_keywords' => true,
'class_attributes_separation' => ['elements' => ['method' => 'one']],
'native_function_invocation' => ['include' => ['@compiler_optimized']],
'no_alias_functions' => true,
'no_closing_tag' => true,
'no_extra_blank_lines' => [
'tokens' => [
'break',
'continue',
'curly_brace_block',
'extra',
'parenthesis_brace_block',
'return',
'square_brace_block',
'throw',
'use',
],
],
'echo_tag_syntax' => ['format' => 'long'],
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_imports' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_order' => true,
'semicolon_after_instruction' => true,
'visibility_required' => [
'elements' => ['method', 'property', 'const']
],
])
;
66 changes: 0 additions & 66 deletions .php_cs

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ master
* Add sonata-project/datagrid-bundle as direct dependency
* Switch to the new security checker
* Migrate from Travis to GitHub Actions
* Fix deprecated PHP-CS rules

v0.2.0
------
Expand Down

0 comments on commit e842c4c

Please sign in to comment.