From cf9ca6bd5ccbf0b2c2963bf5de1b49fe50361e28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Tue, 3 Nov 2026 15:38:09 +0100 Subject: [PATCH] chore: update PHP CodeSniffer and add Pint configuration - Updated phpcs.xml to use Php Coding Standard and optimized rules. - Added pint.json for code style configuration. - Adjusted phpstan.neon to include tests directory and set level to 10. --- phpcs.xml | 147 +++++++++++++++------------------------------------ phpstan.neon | 4 +- pint.json | 77 +++++++++++++++++++++++++++ 3 files changed, 123 insertions(+), 105 deletions(-) create mode 100644 pint.json diff --git a/phpcs.xml b/phpcs.xml index 2e8e8ed..58a1517 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,122 +1,63 @@ - + + + Standard optimisé : Analyse statique complémentaire à Pint. + - src/ - - + + app/ + config/ + database/ + routes/ + + */vendor/* + */storage/* + _ide_helper.php + + - - - - - - - - - - - - - - - - - - - + + + + + + - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + */database/migrations/* diff --git a/phpstan.neon b/phpstan.neon index ffc6c8f..82c0c27 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,6 +5,6 @@ parameters: paths: - src/ + - tests/ - # Level 9 is the highest level - level: 5 + level: 10 diff --git a/pint.json b/pint.json new file mode 100644 index 0000000..d270a74 --- /dev/null +++ b/pint.json @@ -0,0 +1,77 @@ +{ + "preset": "laravel", + "rules": { + "indentation_type": true, + "single_line_empty_body": false, + "types_spaces": { + "space": "single", + "space_multiple_catch": "single" + }, + "control_structure_braces": true, + "new_with_parentheses": { + "anonymous_class": true, + "named_class": true + }, + "class_definition": { + "single_item_single_line": false, + "single_line": false, + "space_before_parenthesis": true + }, + "curly_braces_position": { + "allow_single_line_empty_anonymous_classes": false, + "classes_opening_brace": "next_line_unless_newline_at_signature_end", + "anonymous_classes_opening_brace": "next_line_unless_newline_at_signature_end", + "control_structures_opening_brace": "same_line", + "functions_opening_brace": "next_line_unless_newline_at_signature_end", + "anonymous_functions_opening_brace": "same_line" + }, + "binary_operator_spaces": { + "default": "align_single_space_minimal", + "operators": { + "=": "align_single_space", + "|": "single_space", + "=>": "align_single_space", + ".=": "align_single_space" + } + }, + "concat_space": { + "spacing": "one" + }, + "align_multiline_comment": { + "comment_type": "all_multiline" + }, + "array_indentation": true, + "method_chaining_indentation": true, + "statement_indentation": { + "stick_comment_to_next_continuous_control_statement": true + }, + "no_unused_imports": true, + "fully_qualified_strict_types": { + "import_symbols": true, + "leading_backslash_in_global_namespace": true, + "phpdoc_tags": [] + }, + "visibility_required": { + "elements": [ + "const", + "method", + "property" + ] + }, + "no_useless_else": true, + "function_declaration": { + "closure_function_spacing": "one", + "closure_fn_spacing": "one", + "trailing_comma_single_line": false + }, + "single_line_after_imports": true, + "combine_consecutive_issets": true, + "array_syntax": { + "syntax": "short" + }, + "single_quote": true, + "blank_line_after_namespace": true, + "blank_line_after_opening_tag": true, + "declare_strict_types": true + } +}