Skip to content

Commit

Permalink
update rules to v3 compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
patinthehat committed Jun 1, 2021
1 parent 6d8882a commit 8776bb2
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
// optional: chain additiional custom Finder options:
$finder = ComposerPackageFinder::create(__DIR__);

return SharedConfig::create($finder, new DefaultRuleset());
return SharedConfig::create($finder, new DefaultRuleset());
5 changes: 2 additions & 3 deletions src/Rulesets/LaravelShiftRuleset.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function rules(): array
'braces' => true,
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => ['method'],
'elements' => ['method' => 'one'],
],
'class_definition' => true,
'concat_space' => [
Expand Down Expand Up @@ -102,7 +102,7 @@ public function rules(): array
'normalize_index_brace' => true,
'not_operator_with_successor_space' => true,
'object_operator_without_whitespace' => true,
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'phpdoc_indent' => true,
//'phpdoc_inline_tag' => true,
'phpdoc_no_access' => true,
Expand All @@ -115,7 +115,6 @@ public function rules(): array
'phpdoc_trim' => true,
'phpdoc_types' => true,
'phpdoc_var_without_name' => true,
'psr4' => true,
'self_accessor' => true,
'short_scalar_cast' => true,
'simplified_null_return' => false, // disabled by Shift
Expand Down
52 changes: 26 additions & 26 deletions src/Rulesets/PhpUnitRuleset.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,32 @@ public function rules(): array
],
],
'blank_line_after_namespace' => true,
'blank_line_before_statement' => [
'statements' => [
'break',
'continue',
'declare',
'default',
'die',
'do',
'exit',
'for',
'foreach',
'goto',
'if',
'include',
'include_once',
'require',
'require_once',
'return',
'switch',
'throw',
'try',
'while',
'yield',
'blank_line_before_statement' => ['statements' => [
'break',
'continue',
'declare',
'default',
'do',
'exit',
'for',
'foreach',
'goto',
'if',
'include',
'include_once',
'require',
'require_once',
'return',
'switch',
'throw',
'try',
'while',
'yield',
],
],
'braces' => true,
'cast_spaces' => true,
'class_attributes_separation' => ['elements' => ['const', 'method', 'property']],
'class_attributes_separation' => ['elements' => ['const' => 'one', 'method' => 'one', 'property' => 'one']],
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'compact_nullable_typehint' => true,
Expand Down Expand Up @@ -89,7 +87,7 @@ public function rules(): array
'lowercase_static_reference' => true,
'magic_constant_casing' => true,
'magic_method_casing' => true,
'method_argument_space' => ['ensure_fully_multiline' => true],
// 'on_multiline' => 'ensure_fully_multiline',
'modernize_types_casting' => true,
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => true,
Expand Down Expand Up @@ -214,7 +212,9 @@ public function rules(): array
'standardize_not_equals' => true,
'strict_param' => true,
'ternary_to_null_coalescing' => true,
'trailing_comma_in_multiline_array' => true,
'trailing_comma_in_multiline' => [
'elements' => ['arrays'],
],
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'visibility_required' => [
Expand Down
6 changes: 2 additions & 4 deletions src/Rulesets/SpatieRuleset.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function rules(): array
return array_merge([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline' => [
Expand All @@ -39,9 +39,7 @@ public function rules(): array
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'class_attributes_separation' => [
'elements' => [
'method',
],
'elements' => ['method' => 'one'],
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
Expand Down

0 comments on commit 8776bb2

Please sign in to comment.