Skip to content

Commit de6b1ce

Browse files
committed
update rules: v1.2.0
1 parent d3dfd1b commit de6b1ce

3 files changed

Lines changed: 41 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Changelog
2+
3+
Toutes les modifications notables apportées à cette bibliothèque seront documentées dans ce fichier.
4+
5+
Ce projet adhère à [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [1.2.0](https://github.com/blitz-php/coding-standard/compare/1.1.0...1.2.0) - 2023-07-09
8+
9+
- Passer php-cs-fixer à la v3.18
10+
- correction : jeu de règles obsolète sur la `v3.18`
11+
- Ajout de l'option case_sensitive aux ordered_class_elements
12+
- Ajouter des règles manquantes
13+
14+
## [1.1.0](hhttps://github.com/blitz-php/coding-standard/compare/1.0.1...1.1.0) - 2023-03-22
15+
16+
- Remplacez `single_space_after_construct` par `single_space_around_construct`
17+
- Supprimer les règles `braces` obsolètes
18+
- Passer php-cs-fixer à la v3.16
19+
20+
## [1.0.0](https://github.com/blitz-php/coding-standard/releases/tag/1.0.0) - 2022-09-03
21+
22+
Initial release.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"require": {
1313
"php": "^7.4 || ^8.0",
1414
"ext-tokenizer": "*",
15-
"friendsofphp/php-cs-fixer": "^3.14",
15+
"friendsofphp/php-cs-fixer": "^3.18",
1616
"nexusphp/cs-config": "^3.6"
1717
},
1818
"require-dev": {

src/Blitz.php

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,9 @@ public function __construct()
6565
],
6666
],
6767
'blank_line_between_import_groups' => true,
68-
'braces' => [
69-
'allow_single_line_anonymous_class_with_empty_body' => true,
70-
'allow_single_line_closure' => true,
71-
'position_after_anonymous_constructs' => 'same',
72-
'position_after_control_structures' => 'same',
73-
'position_after_functions_and_oop_constructs' => 'next',
68+
'blank_lines_before_namespace' => [
69+
'min_line_breaks' => 2,
70+
'max_line_breaks' => 2,
7471
],
7572
'cast_spaces' => ['space' => 'single'],
7673
'class_attributes_separation' => [
@@ -151,8 +148,8 @@ public function __construct()
151148
'explicit_string_variable' => true,
152149
'final_class' => false,
153150
'final_internal_class' => [
154-
'annotation_exclude' => ['@no-final'],
155-
'annotation_include' => ['@internal'],
151+
'exclude' => ['no-final'],
152+
'include' => ['internal'],
156153
'consider_absent_docblock_as_internal_class' => false,
157154
],
158155
'final_public_method_for_abstract_class' => false,
@@ -241,7 +238,6 @@ public function __construct()
241238
'no_binary_string' => true,
242239
'no_blank_lines_after_class_opening' => true,
243240
'no_blank_lines_after_phpdoc' => true,
244-
'no_blank_lines_before_namespace' => false, // conflicts with `single_blank_line_before_namespace`
245241
'no_break_comment' => ['comment_text' => 'no break'],
246242
'no_closing_tag' => true,
247243
'no_empty_comment' => true,
@@ -320,13 +316,15 @@ public function __construct()
320316
'method',
321317
],
322318
'sort_algorithm' => 'none',
319+
'case_sensitive' => false,
323320
],
324321
'ordered_imports' => [
325322
'sort_algorithm' => 'alpha',
326323
'imports_order' => ['class', 'function', 'const'],
327324
],
328325
'ordered_interfaces' => false,
329326
'ordered_traits' => false,
327+
'ordered_types' => true,
330328
'php_unit_construct' => [
331329
'assertions' => [
332330
'assertSame',
@@ -431,6 +429,7 @@ public function __construct()
431429
'uses',
432430
],
433431
],
432+
'phpdoc_param_order' => false,
434433
'phpdoc_return_self_reference' => [
435434
'replacements' => [
436435
'this' => '$this',
@@ -505,16 +504,18 @@ public function __construct()
505504
'simplified_if_return' => true,
506505
'simplified_null_return' => false,
507506
'single_blank_line_at_eof' => true,
508-
'single_blank_line_before_namespace' => true,
509507
'single_class_element_per_statement' => ['elements' => ['const', 'property']],
510508
'single_import_per_statement' => ['group_to_single_imports' => true],
511509
'single_line_after_imports' => true,
512510
'single_line_comment_spacing' => true,
513511
'single_line_comment_style' => ['comment_types' => ['asterisk', 'hash']],
512+
'single_line_empty_body' => false,
514513
'single_line_throw' => false,
515514
'single_quote' => ['strings_containing_single_quote_chars' => false],
516-
'single_space_after_construct' => [
517-
'constructs' => [
515+
'single_space_around_construct' => [
516+
'constructs_contain_a_single_space' => ['yield_from'],
517+
'constructs_preceded_by_a_single_space' => ['use_lambda'],
518+
'constructs_followed_by_a_single_space' => [
518519
'abstract',
519520
'as',
520521
'attribute',
@@ -531,6 +532,7 @@ public function __construct()
531532
'echo',
532533
'else',
533534
'elseif',
535+
'enum',
534536
'extends',
535537
'final',
536538
'finally',
@@ -549,6 +551,7 @@ public function __construct()
549551
'interface',
550552
'match',
551553
'named_argument',
554+
'namespace',
552555
'new',
553556
'open_tag_with_echo',
554557
'php_doc',
@@ -557,13 +560,16 @@ public function __construct()
557560
'private',
558561
'protected',
559562
'public',
563+
'readonly',
560564
'require',
561565
'require_once',
562566
'return',
563567
'static',
568+
'switch',
564569
'throw',
565570
'trait',
566571
'try',
572+
'type_colon',
567573
'use',
568574
'use_lambda',
569575
'use_trait',

0 commit comments

Comments
 (0)