Skip to content

Instantly share code, notes, and snippets.

@arvindkumarbadwal
Created May 12, 2020 09:49
Show Gist options
  • Save arvindkumarbadwal/35f52bde6a0460d863c6db45b7ab341d to your computer and use it in GitHub Desktop.
Save arvindkumarbadwal/35f52bde6a0460d863c6db45b7ab341d to your computer and use it in GitHub Desktop.
Laravel - PHP CS Fixer Config
<?php
return PhpCsFixer\Config::create()
->setRules([
'@Symfony' => true,
'align_multiline_comment' => true,
'array_syntax' => ['syntax' => 'short'],
'array_indentation' => true,
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_statement' => [
'statements' => ['return', 'if', 'foreach', 'throw', 'try'],
],
'braces' => true,
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => ['method'],
],
'class_definition' => true,
'elseif' => true,
'function_declaration' => true,
'line_ending' => true,
'lowercase_constants' => true,
'lowercase_keywords' => true,
'no_unused_imports' => true,
'no_extra_blank_lines' => true,
'no_spaces_after_function_name' => true,
'no_spaces_inside_parenthesis' => true,
'no_trailing_whitespace' => true,
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
'phpdoc_indent' => true,
'phpdoc_no_useless_inheritdoc' => true,
'return_assignment' => true,
'short_scalar_cast' => true,
'single_blank_line_at_eof' => true,
'single_class_element_per_statement' => [
'elements' => ['property'],
],
'single_line_comment_style' => [
'comment_types' => ['hash'],
],
'single_quote' => true,
'single_line_after_imports' => true,
'switch_case_space' => true,
'visibility_required' => true,
'whitespace_after_comma_in_array' => true,
'yoda_style' => [
'equal' => false,
'identical' => false,
'less_and_greater' => false,
],
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment