From f8e84b50a83d22ac0b3c9f4236003b36d175f63c Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Fri, 23 Aug 2024 12:25:49 +0200 Subject: [PATCH 1/2] style: add rules for casts https://github.com/nextcloud/coding-standard/issues/24 Signed-off-by: Daniel Kesselberg --- src/Config.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Config.php b/src/Config.php index 63d6cdb..2c84a7c 100644 --- a/src/Config.php +++ b/src/Config.php @@ -24,6 +24,7 @@ public function getRules() : array { ], 'blank_line_after_namespace' => true, 'blank_line_after_opening_tag' => true, + 'cast_spaces' => ['space' => 'single'], 'curly_braces_position' => [ 'classes_opening_brace' => 'same_line', 'functions_opening_brace' => 'same_line', @@ -37,6 +38,7 @@ public function getRules() : array { 'indentation_type' => true, 'line_ending' => true, 'list_syntax' => true, + 'lowercase_cast' => true, 'lowercase_keywords' => true, 'method_argument_space' => [ 'on_multiline' => 'ignore', @@ -44,6 +46,7 @@ public function getRules() : array { 'method_chaining_indentation' => true, 'no_closing_tag' => true, 'no_leading_import_slash' => true, + 'no_short_bool_cast' => true, 'no_spaces_after_function_name' => true, 'no_spaces_inside_parenthesis' => true, 'no_trailing_whitespace' => true, @@ -55,6 +58,7 @@ public function getRules() : array { 'sort_algorithm' => 'alpha' ], 'phpdoc_var_annotation_correct_order' => true, + 'short_scalar_cast' => true, 'single_blank_line_at_eof' => true, 'single_class_element_per_statement' => true, 'single_import_per_statement' => true, From 1f070fdb13b207f024fd8db21741044faedf3a26 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Fri, 23 Aug 2024 12:31:13 +0200 Subject: [PATCH 2/2] style: single quotes https://github.com/nextcloud/coding-standard/issues/23 Signed-off-by: Daniel Kesselberg --- src/Config.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Config.php b/src/Config.php index 2c84a7c..e48ad87 100644 --- a/src/Config.php +++ b/src/Config.php @@ -63,6 +63,7 @@ public function getRules() : array { 'single_class_element_per_statement' => true, 'single_import_per_statement' => true, 'single_line_after_imports' => true, + 'single_quote' => ['strings_containing_single_quote_chars' => false], 'switch_case_space' => true, 'types_spaces' => ['space' => 'none', 'space_multiple_catch' => 'none'], 'visibility_required' => [