Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
sonar.exclusions=tests/lib/Sets/expected_rules/**/*
# Exclude files from duplication detection
sonar.cpd.exclusions=tests/lib/PhpCsFixer/Sets/expected_rules/**
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"require": {
"php": ">=7.4",
"friendsofphp/php-cs-fixer": "v3.75.0",
"friendsofphp/php-cs-fixer": "v3.89.0",
"composer-runtime-api": ">=2.0"
},
"require-dev": {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/PhpCsFixer/Sets/AbstractIbexaRuleSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public function getRules(): array
'trailing_comma_in_multiline' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'visibility_required' => true,
'modifier_keywords' => true,
'whitespace_after_comma_in_array' => true,
'yoda_style' => false,
'fully_qualified_strict_types' => [
Expand All @@ -211,7 +211,7 @@ public function buildConfig(): Config

$config->setRules(array_merge(
$config->getRules(),
static::getRules(),
$this->getRules(),
));

$config->setRiskyAllowed(true);
Expand Down
33 changes: 23 additions & 10 deletions src/lib/PhpCsFixer/Sets/Ibexa46RuleSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,30 @@ public function getRules(): array
return array_merge(
parent::getRules(),
[
'no_spaces_inside_parenthesis' => true,
'braces' => [
'allow_single_line_closure' => true,
'spaces_inside_parentheses' => true,
'single_space_around_construct' => true,
'control_structure_braces' => true,
'control_structure_continuation_position' => true,
'no_multiple_statements_per_line' => true,
'declare_parentheses' => true,
'braces_position' => true,
'statement_indentation' => false,
'type_declaration_spaces' => true,
'native_type_declaration_casing' => true,
'new_with_parentheses' => true,
'no_trailing_comma_in_singleline' => true,
'no_unneeded_braces' => true,
'no_extra_blank_lines' => [
'tokens' => [
'curly_brace_block',
'extra',
'parenthesis_brace_block',
'square_brace_block',
'throw',
'use',
],
],
'function_typehint_space' => true,
'native_function_type_declaration_casing' => true,
'new_with_braces' => true,
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unneeded_curly_braces' => true,
'single_blank_line_before_namespace' => true,
'blank_lines_before_namespace' => true,
],
);
}
Expand Down
12 changes: 5 additions & 7 deletions src/lib/PhpCsFixer/Sets/Ibexa50RuleSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,22 @@ public function getRules(): array
{
return array_merge(
[
'@PER-CS2.0' => true,
'@PER-CS2x0' => true,
],
parent::getRules(),
[
'spaces_inside_parentheses' => [
'space' => 'none',
],
'braces' => [
'allow_single_line_closure' => true,
],
'declare_parentheses' => true,
'type_declaration_spaces' => [
'elements' => [
'function',
'property',
],
],
'native_function_type_declaration_casing' => true,
'new_with_braces' => true,
'native_type_declaration_casing' => true,
'new_with_parentheses' => true,
'no_trailing_comma_in_singleline' => [
'elements' => [
'arguments',
Expand All @@ -40,7 +38,7 @@ public function getRules(): array
'group_import',
],
],
'no_unneeded_curly_braces' => true,
'no_unneeded_braces' => true,
'blank_lines_before_namespace' => true,
'class_definition' => [
'single_item_single_line' => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@
'return',
],
],
'braces' => [
'allow_single_line_closure' => true,
],
'single_space_around_construct' => true,
'control_structure_braces' => true,
'control_structure_continuation_position' => true,
'no_multiple_statements_per_line' => true,
'declare_parentheses' => true,
'braces_position' => true,
'statement_indentation' => false,
'cast_spaces' => false,
'class_attributes_separation' => [
'elements' => [
Expand All @@ -49,7 +53,7 @@
'full_opening_tag' => true,
'function_declaration' => true,
'function_to_constant' => true,
'function_typehint_space' => true,
'type_declaration_spaces' => true,
'general_phpdoc_tag_rename' => true,
'header_comment' => [
'comment_type' => 'PHPDoc',
Expand Down Expand Up @@ -82,8 +86,8 @@
],
'native_function_casing' => true,
'native_function_invocation' => false,
'native_function_type_declaration_casing' => true,
'new_with_braces' => true,
'native_type_declaration_casing' => true,
'new_with_parentheses' => true,
'no_alias_functions' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
Expand Down Expand Up @@ -111,13 +115,12 @@
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_after_function_name' => true,
'no_spaces_around_offset' => true,
'no_spaces_inside_parenthesis' => true,
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'spaces_inside_parentheses' => true,
'no_trailing_comma_in_singleline' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_unneeded_control_parentheses' => true,
'no_unneeded_curly_braces' => true,
'no_unneeded_braces' => true,
'no_unneeded_final_method' => true,
'no_unused_imports' => true,
'no_whitespace_before_comma_in_array' => true,
Expand Down Expand Up @@ -170,7 +173,7 @@
'short_scalar_cast' => true,
'simplified_null_return' => false,
'single_blank_line_at_eof' => true,
'single_blank_line_before_namespace' => true,
'blank_lines_before_namespace' => true,
'single_class_element_per_statement' => true,
'single_import_per_statement' => true,
'single_line_after_imports' => true,
Expand All @@ -191,7 +194,7 @@
'trailing_comma_in_multiline' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'visibility_required' => true,
'modifier_keywords' => true,
'whitespace_after_comma_in_array' => true,
'yoda_style' => false,
'Ibexa/multiline_parameters' => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'declare_equal_normalize' => true,
'lowercase_cast' => true,
'lowercase_static_reference' => true,
'new_with_braces' => true,
'new_with_parentheses' => true,
'no_blank_lines_after_class_opening' => true,
'no_leading_import_slash' => true,
'no_whitespace_in_blank_line' => true,
Expand All @@ -21,7 +21,7 @@
'single_import_per_statement' => true,
'single_trait_insert_per_statement' => true,
'ternary_operator_spaces' => true,
'visibility_required' => true,
'modifier_keywords' => true,
'blank_line_after_namespace' => true,
'constant_case' => [
'case' => 'lower',
Expand Down Expand Up @@ -168,16 +168,18 @@
'concat_space' => [
'spacing' => 'one',
],
'braces' => [
'allow_single_line_closure' => true,
],
'no_spaces_inside_parenthesis' => true,
'function_typehint_space' => true,
'native_function_type_declaration_casing' => true,
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unneeded_curly_braces' => true,
'single_blank_line_before_namespace' => true,
'braces_position' => true,
'single_space_around_construct' => true,
'control_structure_braces' => true,
'control_structure_continuation_position' => true,
'no_multiple_statements_per_line' => true,
'declare_parentheses' => true,
'spaces_inside_parentheses' => true,
'type_declaration_spaces' => true,
'native_type_declaration_casing' => true,
'no_trailing_comma_in_singleline' => true,
'no_unneeded_braces' => true,
'blank_lines_before_namespace' => true,
'Ibexa/multiline_parameters' => true,
'fully_qualified_strict_types' => [
'import_symbols' => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Ibexa\CodeStyle\PhpCsFixer\Sets\AbstractIbexaRuleSet;

return [
'@PER-CS2.0' => true,
'@PER-CS2x0' => true,
'@PSR12' => false,
'array_syntax' => [
'syntax' => 'short',
Expand All @@ -23,9 +23,8 @@
],
],
'blank_lines_before_namespace' => true,
'braces' => [
'allow_single_line_closure' => true,
],
'declare_parentheses' => true,
'no_unneeded_braces' => true,
'cast_spaces' => false,
'class_attributes_separation' => [
'elements' => [
Expand Down Expand Up @@ -86,8 +85,8 @@
],
'native_function_casing' => true,
'native_function_invocation' => false,
'native_function_type_declaration_casing' => true,
'new_with_braces' => true,
'native_type_declaration_casing' => true,
'new_with_parentheses' => true,
'no_alias_functions' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
Expand Down Expand Up @@ -126,7 +125,6 @@
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_unneeded_control_parentheses' => true,
'no_unneeded_curly_braces' => true,
'no_unneeded_final_method' => true,
'no_unused_imports' => true,
'no_whitespace_before_comma_in_array' => true,
Expand Down Expand Up @@ -214,7 +212,7 @@
'space' => 'single',
],
'unary_operator_spaces' => true,
'visibility_required' => true,
'modifier_keywords' => true,
'whitespace_after_comma_in_array' => true,
'yoda_style' => false,
'Ibexa/multiline_parameters' => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
'declare_equal_normalize' => true,
'lowercase_cast' => true,
'lowercase_static_reference' => true,
'new_with_braces' => true,
'no_blank_lines_after_class_opening' => true,
'no_leading_import_slash' => true,
'no_whitespace_in_blank_line' => true,
Expand All @@ -31,7 +30,7 @@
'single_import_per_statement' => true,
'single_trait_insert_per_statement' => true,
'ternary_operator_spaces' => true,
'visibility_required' => true,
'modifier_keywords' => true,
'blank_line_after_namespace' => true,
'constant_case' => [
'case' => 'lower',
Expand Down Expand Up @@ -178,16 +177,15 @@
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'whitespace_after_comma_in_array' => true,
'braces' => [
'allow_single_line_closure' => true,
],
'declare_parentheses' => true,
'new_with_parentheses' => true,
'type_declaration_spaces' => [
'elements' => [
'function',
'property',
],
],
'native_function_type_declaration_casing' => true,
'native_type_declaration_casing' => true,
'no_trailing_comma_in_singleline' => [
'elements' => [
'arguments',
Expand All @@ -196,7 +194,7 @@
'group_import',
],
],
'no_unneeded_curly_braces' => true,
'no_unneeded_braces' => true,
'php_unit_test_case_static_method_calls' => [
'call_type' => 'self',
],
Expand Down