cs: Enable more risky rules.

This commit is contained in:
Pol Dellaiera 2021-11-30 12:19:29 +01:00
parent 579c349e28
commit 733bee06a8
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA
5 changed files with 26 additions and 26 deletions

View File

@ -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(

View File

@ -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');

View File

@ -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');

View File

@ -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

View File

@ -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');