|  | 
|  | 1 | +<?php | 
|  | 2 | + | 
|  | 3 | +/** | 
|  | 4 | + * Ruleset for Laravel projects also using Prettier PHP plugin. | 
|  | 5 | + *  | 
|  | 6 | + * @see https://git.io/JJASj | 
|  | 7 | + */ | 
|  | 8 | +return [ | 
|  | 9 | + '@PSR2' => true, | 
|  | 10 | + 'array_syntax' => ['syntax' => 'short'], | 
|  | 11 | + 'binary_operator_spaces' => [ | 
|  | 12 | + 'default' => 'single_space', | 
|  | 13 | + 'operators' => ['=>' => null], | 
|  | 14 | + ], | 
|  | 15 | + 'blank_line_after_namespace' => true, | 
|  | 16 | + 'blank_line_after_opening_tag' => true, | 
|  | 17 | + 'blank_line_before_statement' => [ | 
|  | 18 | + 'statements' => ['return'], | 
|  | 19 | + ], | 
|  | 20 | + 'braces' => true, | 
|  | 21 | + 'cast_spaces' => true, | 
|  | 22 | + 'class_attributes_separation' => [ | 
|  | 23 | + 'elements' => ['method'], | 
|  | 24 | + ], | 
|  | 25 | + 'class_definition' => true, | 
|  | 26 | + 'concat_space' => [ | 
|  | 27 | + 'spacing' => 'one', | 
|  | 28 | + ], | 
|  | 29 | + 'declare_equal_normalize' => true, | 
|  | 30 | + 'elseif' => true, | 
|  | 31 | + 'encoding' => true, | 
|  | 32 | + 'full_opening_tag' => true, | 
|  | 33 | + 'fully_qualified_strict_types' => true, | 
|  | 34 | + 'function_declaration' => true, | 
|  | 35 | + 'function_typehint_space' => true, | 
|  | 36 | + 'heredoc_to_nowdoc' => true, | 
|  | 37 | + 'include' => true, | 
|  | 38 | + 'increment_style' => ['style' => 'post'], | 
|  | 39 | + 'indentation_type' => true, | 
|  | 40 | + 'linebreak_after_opening_tag' => true, | 
|  | 41 | + 'line_ending' => true, | 
|  | 42 | + 'lowercase_cast' => true, | 
|  | 43 | + 'lowercase_constants' => true, | 
|  | 44 | + 'lowercase_keywords' => true, | 
|  | 45 | + 'lowercase_static_reference' => true, | 
|  | 46 | + 'magic_method_casing' => true, | 
|  | 47 | + 'magic_constant_casing' => true, | 
|  | 48 | + 'method_argument_space' => true, | 
|  | 49 | + 'native_function_casing' => true, | 
|  | 50 | + 'no_alias_functions' => true, | 
|  | 51 | + 'no_extra_blank_lines' => [ | 
|  | 52 | + 'tokens' => [ | 
|  | 53 | + 'extra', | 
|  | 54 | + 'throw', | 
|  | 55 | + 'use', | 
|  | 56 | + 'use_trait', | 
|  | 57 | + ], | 
|  | 58 | + ], | 
|  | 59 | + 'no_blank_lines_after_class_opening' => true, | 
|  | 60 | + 'no_blank_lines_after_phpdoc' => true, | 
|  | 61 | + 'no_closing_tag' => true, | 
|  | 62 | + 'no_empty_phpdoc' => true, | 
|  | 63 | + 'no_empty_statement' => true, | 
|  | 64 | + 'no_leading_import_slash' => true, | 
|  | 65 | + 'no_leading_namespace_whitespace' => true, | 
|  | 66 | + 'no_mixed_echo_print' => [ | 
|  | 67 | + 'use' => 'echo', | 
|  | 68 | + ], | 
|  | 69 | + 'no_multiline_whitespace_around_double_arrow' => false, | 
|  | 70 | + 'multiline_whitespace_before_semicolons' => [ | 
|  | 71 | + 'strategy' => 'no_multi_line', | 
|  | 72 | + ], | 
|  | 73 | + 'no_short_bool_cast' => true, | 
|  | 74 | + 'no_singleline_whitespace_before_semicolons' => true, | 
|  | 75 | + 'no_spaces_after_function_name' => true, | 
|  | 76 | + 'no_spaces_around_offset' => true, | 
|  | 77 | + 'no_spaces_inside_parenthesis' => true, | 
|  | 78 | + 'no_trailing_comma_in_list_call' => true, | 
|  | 79 | + 'no_trailing_comma_in_singleline_array' => true, | 
|  | 80 | + 'no_trailing_whitespace' => true, | 
|  | 81 | + 'no_trailing_whitespace_in_comment' => true, | 
|  | 82 | + 'no_unneeded_control_parentheses' => true, | 
|  | 83 | + 'no_unreachable_default_argument_value' => true, | 
|  | 84 | + 'no_useless_return' => true, | 
|  | 85 | + 'no_whitespace_before_comma_in_array' => true, | 
|  | 86 | + 'no_whitespace_in_blank_line' => true, | 
|  | 87 | + 'normalize_index_brace' => true, | 
|  | 88 | + 'not_operator_with_successor_space' => false, | 
|  | 89 | + 'object_operator_without_whitespace' => true, | 
|  | 90 | + 'ordered_imports' => ['sortAlgorithm' => 'alpha'], | 
|  | 91 | + 'phpdoc_indent' => true, | 
|  | 92 | + 'phpdoc_inline_tag' => true, | 
|  | 93 | + 'phpdoc_no_access' => true, | 
|  | 94 | + 'phpdoc_no_package' => true, | 
|  | 95 | + 'phpdoc_no_useless_inheritdoc' => true, | 
|  | 96 | + 'phpdoc_scalar' => true, | 
|  | 97 | + 'phpdoc_single_line_var_spacing' => true, | 
|  | 98 | + 'phpdoc_summary' => true, | 
|  | 99 | + 'phpdoc_to_comment' => true, | 
|  | 100 | + 'phpdoc_trim' => true, | 
|  | 101 | + 'phpdoc_types' => true, | 
|  | 102 | + 'phpdoc_var_without_name' => true, | 
|  | 103 | + 'psr4' => true, | 
|  | 104 | + 'self_accessor' => true, | 
|  | 105 | + 'short_scalar_cast' => true, | 
|  | 106 | + 'simplified_null_return' => false, | 
|  | 107 | + 'single_blank_line_at_eof' => true, | 
|  | 108 | + 'single_blank_line_before_namespace' => true, | 
|  | 109 | + 'single_class_element_per_statement' => true, | 
|  | 110 | + 'single_import_per_statement' => true, | 
|  | 111 | + 'single_line_after_imports' => true, | 
|  | 112 | + 'single_line_comment_style' => [ | 
|  | 113 | + 'comment_types' => ['hash'], | 
|  | 114 | + ], | 
|  | 115 | + 'single_quote' => true, | 
|  | 116 | + 'space_after_semicolon' => true, | 
|  | 117 | + 'standardize_not_equals' => true, | 
|  | 118 | + 'switch_case_semicolon_to_colon' => true, | 
|  | 119 | + 'switch_case_space' => true, | 
|  | 120 | + 'ternary_operator_spaces' => true, | 
|  | 121 | + 'trailing_comma_in_multiline_array' => true, | 
|  | 122 | + 'trim_array_spaces' => true, | 
|  | 123 | + 'unary_operator_spaces' => true, | 
|  | 124 | + 'visibility_required' => [ | 
|  | 125 | + 'elements' => ['method', 'property'], | 
|  | 126 | + ], | 
|  | 127 | + 'whitespace_after_comma_in_array' => true, | 
|  | 128 | +]; | 
0 commit comments