diff --git a/CHANGELOG.md b/CHANGELOG.md index 88758a3..6e794a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,29 @@ # Changelog All notable changes to this project will be documented in this file. +## 1.2.0 - 2024-02-01 +### Added +- `array_syntax`: Force short syntax for array +- `list_syntax`: Same for list +- `fully_qualified_strict_types`: Remove namespace from classname when there is a `use` statement, and add missing backslash for global namespace +- `no_leading_import_slash`: Remove leading slash from `use` statement +- `nullable_type_declaration_for_default_null_value`: Add missing `?` on type declaration for parameters defaulting to `null`. This will most likely be needed to avoid warnings in PHP 8.4. +- `yoda_style`: forbid yoda style comparision. This replaces `null === $a` by `$a === null`. + +## 1.1.1 - 2023-06-23 +### Changed +* feat: use php-cs-fixer/shim by @kesselb in https://github.com/nextcloud/coding-standard/pull/13 + +## 1.1.0 - 2023-04-13 +### Changed +* Order imports alphabetically by @come-nc in https://github.com/nextcloud/coding-standard/pull/10 +* fix(rules): Replace deprecated braces rules by @nickvergessen in https://github.com/nextcloud/coding-standard/pull/12 + +## 1.0.0 – 2021-11-10 +### Breaking change +* Update php-cs-fixer to 3.x +* See https://github.com/nextcloud/coding-standard#upgrade-from-v0x-to-v10 for instructions. + ## 0.5.0 – 2021-01-11 ### Added - New rule: short list syntax diff --git a/src/Config.php b/src/Config.php index c6b229a..058fd71 100644 --- a/src/Config.php +++ b/src/Config.php @@ -18,6 +18,7 @@ public function getRules() : array { '@PSR2' => true, 'align_multiline_comment' => true, 'array_indentation' => true, + 'array_syntax' => true, 'binary_operator_spaces' => [ 'default' => 'single_space', ], @@ -30,21 +31,25 @@ public function getRules() : array { 'elseif' => true, 'encoding' => true, 'full_opening_tag' => true, + 'fully_qualified_strict_types' => ['leading_backslash_in_global_namespace' => true], 'function_declaration' => [ 'closure_function_spacing' => 'one', ], 'indentation_type' => true, 'line_ending' => true, + 'list_syntax' => true, 'lowercase_keywords' => true, 'method_argument_space' => [ 'on_multiline' => 'ignore', ], 'no_closing_tag' => true, + 'no_leading_import_slash' => true, 'no_spaces_after_function_name' => true, 'no_spaces_inside_parenthesis' => true, 'no_trailing_whitespace' => true, 'no_trailing_whitespace_in_comment' => true, 'no_unused_imports' => true, + 'nullable_type_declaration_for_default_null_value' => true, 'ordered_imports' => [ 'imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha' @@ -57,6 +62,7 @@ public function getRules() : array { 'visibility_required' => [ 'elements' => ['property', 'method', 'const'] ], + 'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false], ]; } }