Skip to content

Instantly share code, notes, and snippets.

@HedicGuibert
Created March 13, 2023 13:16
Show Gist options
  • Save HedicGuibert/30437a38ba306208c965c221e62979bd to your computer and use it in GitHub Desktop.
Save HedicGuibert/30437a38ba306208c965c221e62979bd to your computer and use it in GitHub Desktop.
PHP-CS-Fixer 3.15.0 bug report config file
<?php
$header = <<<'EOF'
This file is part of JoliCode's json-ld project.
(c) jolicode.com <coucou@jolicode.com>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF;
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'header_comment' => ['header' => $header],
'array_syntax' => ['syntax' => 'short'],
'ordered_class_elements' => true,
'ordered_imports' => true,
'heredoc_to_nowdoc' => true,
'php_unit_strict' => true,
'php_unit_construct' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_order' => true,
'strict_comparison' => true,
'strict_param' => true,
'no_extra_blank_lines' => [
'tokens' => [
'break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block'
],
],
'echo_tag_syntax' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'semicolon_after_instruction' => true,
'combine_consecutive_unsets' => true,
'blank_line_before_statement' => [
'statements' => [
'break', 'continue', 'declare', 'foreach', 'if', 'return', 'throw', 'try', 'while'
],
],
'concat_space' => ['spacing' => 'one'],
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('var')
->exclude('vendor')
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment