Skip to content

Instantly share code, notes, and snippets.

@chriwo
Last active November 23, 2017 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chriwo/88bf7832839d59b37d40507c18ddaf73 to your computer and use it in GitHub Desktop.
Save chriwo/88bf7832839d59b37d40507c18ddaf73 to your computer and use it in GitHub Desktop.
Configuration file of PHP-CS-FIXER for TYPO3 projects
<?php
$header = <<<'EOF'
This file is part of PHP CS Fixer.
(c) Fabien Potencier <fabien@symfony.com>
Dariusz Rumiński <dariusz.ruminski@gmail.com>
This source file is subject to the MIT license that is bundled
with this source code in the file LICENSE.
EOF;
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@PHP70Migration' => true,
'@Symfony' => true,
'@Symfony:risky' => false,
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => true,
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => false,
'blank_line_before_return' => false,
'combine_consecutive_unsets' => true,
'concat_space' => ['spacing' => 'one'],
'function_typehint_space' => true,
'general_phpdoc_annotation_remove' => ['package', 'subpackage', 'expectedException', 'expectedExceptionMessage', 'expectedExceptionMessageRegExp'],
'hash_to_slash_comment' => true,
'heredoc_to_nowdoc' => true,
'list_syntax' => ['syntax' => 'long'],
'lowercase_cast' => true,
'semicolon_after_instruction' => true,
'short_scalar_cast' => true,
'single_blank_line_before_namespace' => false,
'single_quote' => true,
'strict_comparison' => true,
'strict_param' => true,
'method_separation' => true,
'native_function_casing' => true,
'new_with_braces' => true,
'no_alias_functions' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_blank_lines_before_namespace' => true,
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_consecutive_blank_lines' => ['break', 'continue', 'return', 'extra', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block'],
'no_short_echo_tag' => true,
'no_unreachable_default_argument_value' => true,
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'no_whitespace_in_blank_line' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'php_unit_strict' => true,
'php_unit_test_class_requires_covers' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_align' => [],
'phpdoc_no_empty_return' => false,
'phpdoc_no_package' => true,
'phpdoc_order' => true,
'phpdoc_scalar' => true,
'phpdoc_types' => true,
'phpdoc_separation' => false,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_trim' => true,
'self_accessor' => true,
'short_scalar_cast' => true,
'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline_array' => true,
'whitespace_after_comma_in_array' => true,
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('Tests/Fixtures')
->exclude('doc')
->exclude('Documentation')
->exclude('Resources')
->notName('ext_emconf.php')
)
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment