From 733bee06a84142daf37d29fe17f1c8cfb5f68838 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 30 Nov 2021 12:19:29 +0100 Subject: [PATCH] cs: Enable more risky rules. --- .php_cs.dist.php | 44 +++++++++---------- .../test/Fixtures/App/web/app_dev.php | 2 +- .../test/Fixtures/App/web/app_dev.php | 2 +- .../Tests/Export/ExportManagerTest.php | 2 +- .../test/Fixtures/App/web/app_dev.php | 2 +- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.php_cs.dist.php b/.php_cs.dist.php index 40a8ea8b9..8ae10eb9a 100644 --- a/.php_cs.dist.php +++ b/.php_cs.dist.php @@ -22,6 +22,26 @@ $rules = $config->getRules(); $riskyRules = [ 'final_internal_class' => false, + 'strict_param' => false, + 'declare_strict_types' => false, + 'ternary_to_elvis_operator' => false, + 'no_unreachable_default_argument_value' => false, + 'php_unit_test_case_static_method_calls' => false, + 'strict_comparison' => false, + 'ereg_to_preg' => false, + 'php_unit_mock_short_will_return' => false, + 'php_unit_set_up_tear_down_visibility' => false, + 'ordered_interfaces' => false, + 'php_unit_construct' => false, + 'php_unit_dedicate_assert' => false, + 'php_unit_expectation' => false, + 'php_unit_mock' => false, + 'php_unit_namespaced' => false, + 'php_unit_no_expectation_annotation' => false, + 'php_unit_test_annotation' => false, + // 'error_suppression' => false, + // 'non_printable_character' => false, + // 'ordered_traits' => false, // 'no_useless_sprintf' => false, // 'dir_constant' => false, // 'no_alias_functions' => false, @@ -30,43 +50,23 @@ $riskyRules = [ // 'pow_to_exponentiation' => false, // 'comment_to_phpdoc' => false, // 'no_unset_on_property' => false, - 'strict_param' => false, // 'native_constant_invocation' => false, - 'php_unit_test_annotation' => false, - 'php_unit_no_expectation_annotation' => false, - 'declare_strict_types' => false, // 'function_to_constant' => false, // 'is_null' => false, // 'native_function_invocation' => false, - 'ternary_to_elvis_operator' => false, // 'no_trailing_whitespace_in_string' => false, - 'no_unreachable_default_argument_value' => false, - 'php_unit_test_case_static_method_calls' => false, - 'strict_comparison' => false, // 'array_push' => false, - 'ereg_to_preg' => false, - 'error_suppression' => false, // 'fopen_flag_order' => false, // 'fopen_flags' => false, // 'logical_operators' => false, // 'modernize_types_casting' => false, // 'no_homoglyph_names' => false, // 'no_unneeded_final_method' => false, - 'non_printable_character' => false, - 'ordered_traits' => false, - 'php_unit_mock_short_will_return' => false, - 'php_unit_set_up_tear_down_visibility' => false, - // 'set_type_to_cast' => false, - // 'string_line_ending' => false, - 'ordered_interfaces' => false, - 'php_unit_expectation' => false, - 'php_unit_mock' => false, - 'php_unit_namespaced' => false, // 'random_api_migration' => false, // 'static_lambda' => false, - 'php_unit_construct' => false, + // 'set_type_to_cast' => false, + // 'string_line_ending' => false, // 'psr_autoloading' => false, - 'php_unit_dedicate_assert' => false, ]; $rules = array_merge( diff --git a/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/web/app_dev.php b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/web/app_dev.php index ba2ce9f21..3122a0243 100644 --- a/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/web/app_dev.php +++ b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/web/app_dev.php @@ -18,7 +18,7 @@ use Symfony\Component\HttpFoundation\Request; // Feel free to remove this, extend it, or make something more sophisticated. if (isset($_SERVER['HTTP_CLIENT_IP']) || isset($_SERVER['HTTP_X_FORWARDED_FOR']) - || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || \PHP_SAPI === 'cli-server') + || !(in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || \PHP_SAPI === 'cli-server') ) { header('HTTP/1.0 403 Forbidden'); diff --git a/src/Bundle/ChillCustomFieldsBundle/Resources/test/Fixtures/App/web/app_dev.php b/src/Bundle/ChillCustomFieldsBundle/Resources/test/Fixtures/App/web/app_dev.php index ba2ce9f21..3122a0243 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Resources/test/Fixtures/App/web/app_dev.php +++ b/src/Bundle/ChillCustomFieldsBundle/Resources/test/Fixtures/App/web/app_dev.php @@ -18,7 +18,7 @@ use Symfony\Component\HttpFoundation\Request; // Feel free to remove this, extend it, or make something more sophisticated. if (isset($_SERVER['HTTP_CLIENT_IP']) || isset($_SERVER['HTTP_X_FORWARDED_FOR']) - || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || \PHP_SAPI === 'cli-server') + || !(in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || \PHP_SAPI === 'cli-server') ) { header('HTTP/1.0 403 Forbidden'); diff --git a/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php b/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php index 2cb490ac0..b50b7262a 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php @@ -32,8 +32,8 @@ use function count; class ExportManagerTest extends KernelTestCase { use \Chill\MainBundle\Test\PrepareCenterTrait; - use \Chill\MainBundle\Test\PrepareUserTrait; use \Chill\MainBundle\Test\PrepareScopeTrait; + use \Chill\MainBundle\Test\PrepareUserTrait; /** * @var Prophecy\Prophet diff --git a/src/Bundle/ChillPersonBundle/Resources/test/Fixtures/App/web/app_dev.php b/src/Bundle/ChillPersonBundle/Resources/test/Fixtures/App/web/app_dev.php index ba2ce9f21..3122a0243 100644 --- a/src/Bundle/ChillPersonBundle/Resources/test/Fixtures/App/web/app_dev.php +++ b/src/Bundle/ChillPersonBundle/Resources/test/Fixtures/App/web/app_dev.php @@ -18,7 +18,7 @@ use Symfony\Component\HttpFoundation\Request; // Feel free to remove this, extend it, or make something more sophisticated. if (isset($_SERVER['HTTP_CLIENT_IP']) || isset($_SERVER['HTTP_X_FORWARDED_FOR']) - || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || \PHP_SAPI === 'cli-server') + || !(in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || \PHP_SAPI === 'cli-server') ) { header('HTTP/1.0 403 Forbidden');