nguyenvanduocit
5/10/2018 - 10:05 AM

.php_sc

<?php
/**
 * Config for PHP-CS-Fixer ver2
 */
$rules = [
    '@PSR2' => true,
    // addtional rules
    'array_syntax' => ['syntax' => 'short'],
    'no_multiline_whitespace_before_semicolons' => true,
    'no_short_echo_tag' => true,
    'no_unused_imports' => true,
    'not_operator_with_successor_space' => false,
    'blank_line_before_statement' => [
        'statements' => ['return']
    ],
    'method_argument_space' => [
        'ensure_fully_multiline' => true
    ],
    'ordered_class_elements' => true,
    'align_multiline_comment' => [
        'comment_type' => 'phpdocs_only'
    ],
    'array_indentation' => true,
    'blank_line_after_namespace' => true,
    'combine_consecutive_issets' => true,
    'combine_consecutive_unsets' => true,
    'explicit_string_variable' => true,
    'fully_qualified_strict_types' => true,
    'linebreak_after_opening_tag' => true,
    'multiline_whitespace_before_semicolons' => true,
    'no_extra_blank_lines' => ['extra'],
    'no_null_property_initialization' => true,
    'no_useless_else' => true,
    'no_useless_return' => true,
    'simplified_null_return' => true,

];
$excludes = [
    // add exclude project directory
    'vendor',
    'node_modules',
];
return PhpCsFixer\Config::create()
    ->setRules($rules)
    ->setFinder(
        PhpCsFixer\Finder::create()
            ->exclude($excludes)
            ->notName('README.md')
            ->notName('*.xml')
            ->notName('*.yml')
    );