From 898486785a0098b51c30a9f0999a089f1672bd4d Mon Sep 17 00:00:00 2001 From: Filippo Tessarotto Date: Thu, 25 Sep 2025 14:42:01 +0200 Subject: [PATCH] Fix deprecations --- composer.json | 4 +- lib/Config.php | 121 ++++++++++++++++++++++++------------------------- 2 files changed, 62 insertions(+), 63 deletions(-) diff --git a/composer.json b/composer.json index 54a999e..16b4e7a 100644 --- a/composer.json +++ b/composer.json @@ -13,10 +13,10 @@ "php": "~8.3.0 || ~8.4.0", "ext-mbstring": "*", "ext-tokenizer": "*", - "friendsofphp/php-cs-fixer": "^3.87.2" + "friendsofphp/php-cs-fixer": "^3.88.0" }, "require-dev": { - "phpstan/phpstan": "^2.1.28", + "phpstan/phpstan": "^2.1.29", "phpstan/phpstan-phpunit": "^2.0.7", "phpunit/phpunit": "^12.3.14" }, diff --git a/lib/Config.php b/lib/Config.php index 8958d51..2e67a48 100644 --- a/lib/Config.php +++ b/lib/Config.php @@ -9,67 +9,66 @@ final class Config extends PhpCsFixerConfig { public const RULES = [ - '@DoctrineAnnotation' => true, - '@PhpCsFixer' => true, - '@PhpCsFixer:risky' => true, - '@PHP80Migration:risky' => true, - '@PHP81Migration' => true, - '@PHPUnit84Migration:risky' => true, - 'Slam/final_abstract_public' => true, - 'Slam/final_internal_class' => true, - 'Slam/function_reference_space' => true, - 'Slam/php_only_slam_inline_comment_spacer' => true, - 'Slam/utf8' => true, - 'align_multiline_comment' => ['comment_type' => 'all_multiline'], - 'binary_operator_spaces' => ['default' => 'align_single_space'], - 'combine_consecutive_issets' => false, - 'combine_consecutive_unsets' => false, - 'comment_to_phpdoc' => false, - 'concat_space' => ['spacing' => 'one'], - 'date_time_create_from_format_call' => true, - 'date_time_immutable' => false, - 'error_suppression' => false, - 'final_class' => false, - 'final_internal_class' => false, - 'final_public_method_for_abstract_class' => false, - 'general_phpdoc_annotation_remove' => false, - 'global_namespace_import' => true, - 'group_import' => false, - 'header_comment' => false, - 'heredoc_indentation' => false, - 'mb_str_functions' => false, - 'method_argument_space' => ['keep_multiple_spaces_after_comma' => true], - 'native_constant_invocation' => true, - 'native_function_invocation' => ['include' => ['@internal']], - 'no_multiline_whitespace_around_double_arrow' => false, - 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true], - 'not_operator_with_space' => false, - 'not_operator_with_successor_space' => true, - 'ordered_class_elements' => ['order' => ['use_trait', 'constant_public', 'constant_protected', 'constant_private', 'property', 'construct', 'destruct', 'magic', 'phpunit', 'method']], - 'ordered_interfaces' => true, - 'php_unit_data_provider_static' => true, - 'php_unit_internal_class' => false, - 'php_unit_size_class' => false, - 'php_unit_strict' => false, - 'php_unit_test_class_requires_covers' => false, - 'phpdoc_add_missing_param_annotation' => false, - 'phpdoc_line_span' => ['const' => 'single', 'property' => 'single', 'method' => 'single'], - 'phpdoc_tag_casing' => true, - 'phpdoc_to_param_type' => false, - 'phpdoc_to_property_type' => true, - 'phpdoc_to_return_type' => false, - 'pow_to_exponentiation' => false, - // 'psr0' => true, - 'random_api_migration' => true, - 'regular_callable_call' => true, - 'simple_to_complex_string_variable' => false, - 'simplified_if_return' => true, - 'simplified_null_return' => false, - 'single_line_throw' => false, - 'space_after_semicolon' => true, - 'static_lambda' => false, - 'unary_operator_spaces' => false, - 'use_arrow_functions' => false, + '@DoctrineAnnotation' => true, + '@PhpCsFixer' => true, + '@PhpCsFixer:risky' => true, + '@PHP8x0Migration:risky' => true, + '@PHP8x1Migration' => true, + '@PHPUnit8x4Migration:risky' => true, + 'Slam/final_abstract_public' => true, + 'Slam/final_internal_class' => true, + 'Slam/function_reference_space' => true, + 'Slam/php_only_slam_inline_comment_spacer' => true, + 'Slam/utf8' => true, + 'align_multiline_comment' => ['comment_type' => 'all_multiline'], + 'binary_operator_spaces' => ['default' => 'align_single_space'], + 'combine_consecutive_issets' => false, + 'combine_consecutive_unsets' => false, + 'comment_to_phpdoc' => false, + 'concat_space' => ['spacing' => 'one'], + 'date_time_create_from_format_call' => true, + 'date_time_immutable' => false, + 'error_suppression' => false, + 'final_class' => false, + 'final_internal_class' => false, + 'final_public_method_for_abstract_class' => false, + 'general_phpdoc_annotation_remove' => false, + 'global_namespace_import' => true, + 'group_import' => false, + 'header_comment' => false, + 'heredoc_indentation' => false, + 'mb_str_functions' => false, + 'method_argument_space' => ['keep_multiple_spaces_after_comma' => true], + 'native_constant_invocation' => true, + 'native_function_invocation' => ['include' => ['@internal']], + 'no_multiline_whitespace_around_double_arrow' => false, + 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true], + 'not_operator_with_space' => false, + 'not_operator_with_successor_space' => true, + 'ordered_class_elements' => ['order' => ['use_trait', 'constant_public', 'constant_protected', 'constant_private', 'property', 'construct', 'destruct', 'magic', 'phpunit', 'method']], + 'ordered_interfaces' => true, + 'php_unit_data_provider_static' => true, + 'php_unit_internal_class' => false, + 'php_unit_size_class' => false, + 'php_unit_strict' => false, + 'php_unit_test_class_requires_covers' => false, + 'phpdoc_add_missing_param_annotation' => false, + 'phpdoc_line_span' => ['const' => 'single', 'property' => 'single', 'method' => 'single'], + 'phpdoc_tag_casing' => true, + 'phpdoc_to_param_type' => false, + 'phpdoc_to_property_type' => true, + 'phpdoc_to_return_type' => false, + 'pow_to_exponentiation' => false, + 'random_api_migration' => true, + 'regular_callable_call' => true, + 'simple_to_complex_string_variable' => false, + 'simplified_if_return' => true, + 'simplified_null_return' => false, + 'single_line_throw' => false, + 'space_after_semicolon' => true, + 'static_lambda' => false, + 'unary_operator_spaces' => false, + 'use_arrow_functions' => false, ]; /** @param array $overriddenRules */