Skip to content

Commit

Permalink
Create .php_cs.dist
Browse files Browse the repository at this point in the history
  • Loading branch information
realodix committed Sep 4, 2019
1 parent 27d89ea commit 06403f4
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php

// Based on https://github.com/stechstudio/Laravel-PHP-CS-Fixer/blob/master/config/fixer.php
$rules = [
'psr0' => false,
'@PSR2' => true,
'blank_line_after_namespace' => true,
'braces' => true,
'class_definition' => true,
'elseif' => true,
'encoding' => true,
'full_opening_tag' => true,
'function_declaration' => true,
'indentation_type' => true,
'line_ending' => true,
'lowercase_constants' => true,
'lowercase_keywords' => true,
'method_argument_space' => [
'ensure_fully_multiline' => true
],
'no_break_comment' => true,
'no_closing_tag' => true,
'no_spaces_after_function_name' => true,
'no_spaces_inside_parenthesis' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'single_blank_line_at_eof' => true,
'single_class_element_per_statement' => [
'elements' => ['property']
],
'single_import_per_statement' => true,
'single_line_after_imports' => true,
'switch_case_semicolon_to_colon' => true,
'switch_case_space' => true,
'visibility_required' => true,
];

$excludes = [
'bootstrap/cache',
'node_modules',
'storage',
'public'
];

$finder = PhpCsFixer\Finder::create()
->exclude($excludes)
->in(__DIR__)
->notName('*.blade.php')
->notName('.phpstorm.meta.php')
->notName('_ide_*.php');

return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules($rules)
->setFinder($finder);

0 comments on commit 06403f4

Please sign in to comment.