Skip to content

Instantly share code, notes, and snippets.

@phcostabh
Created December 23, 2019 04:50
Show Gist options
  • Save phcostabh/4f79159b203f5df268fc798a760e4a43 to your computer and use it in GitHub Desktop.
Save phcostabh/4f79159b203f5df268fc798a760e4a43 to your computer and use it in GitHub Desktop.

Revisions

  1. Philippe Santana Costa created this gist Dec 23, 2019.
    38 changes: 38 additions & 0 deletions .php_cs.dist
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    <?php

    namespace PhpCsFixer {
    $finder = Finder::create()
    ->notPath('bootstrap/cache')
    ->notPath('storage')
    ->notPath('vendor')
    ->in(__DIR__)
    ->name('*.php')
    ->notName('*.blade.php')
    ->ignoreDotFiles(true)
    ->ignoreVCS(true);

    $fixers = [
    '@Symfony' => true,
    '@Symfony:risky' => true,
    '@PhpCsFixer' => true,
    '@PhpCsFixer:risky' => true,
    'array_indentation' => true,
    'array_syntax' => ['syntax' => 'short'],
    'binary_operator_spaces' => ['align_double_arrow' => false],
    'braces' => true,
    'indentation_type' => true,
    'linebreak_after_opening_tag' => true,
    'method_chaining_indentation' => true,
    'multiline_whitespace_before_semicolons' => false,
    'not_operator_with_successor_space' => true,
    'ordered_imports' => true,
    'phpdoc_align' => ['align' => 'left'],
    'phpdoc_order' => true,
    'phpdoc_to_return_type' => true,
    ];

    return Config::create()
    ->setRules($fixers)
    ->setFinder($finder)
    ->setRiskyAllowed(true);
    }