diff --git a/.no-header.php-cs-fixer.dist.php b/.no-header.php-cs-fixer.dist.php index ebbe6789fdbd..6e0a5c09602d 100644 --- a/.no-header.php-cs-fixer.dist.php +++ b/.no-header.php-cs-fixer.dist.php @@ -28,8 +28,16 @@ ->notName('#Logger\.php$#'); $overrides = [ - // @TODO Remove once live in coding-standard - 'no_alternative_syntax' => ['fix_non_monolithic_code' => false], + // @TODO Remove once these are live in coding-standard + 'assign_null_coalescing_to_coalesce_equal' => false, // requires 7.4+ + 'control_structure_continuation_position' => ['position' => 'same_line'], + 'empty_loop_condition' => ['style' => 'while'], + 'integer_literal_case' => true, + 'modernize_strpos' => false, // requires 8.0+ + 'no_alternative_syntax' => ['fix_non_monolithic_code' => false], + 'no_space_around_double_colon' => true, + 'octal_notation' => false, // requires 8.1+ + 'string_length_to_empty' => true, ]; $options = [ diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index a7b41e4a642b..2196640dae93 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -35,8 +35,16 @@ ]); $overrides = [ - // @TODO Remove once live in coding-standard - 'no_alternative_syntax' => ['fix_non_monolithic_code' => false], + // @TODO Remove once these are live in coding-standard + 'assign_null_coalescing_to_coalesce_equal' => false, // requires 7.4+ + 'control_structure_continuation_position' => ['position' => 'same_line'], + 'empty_loop_condition' => ['style' => 'while'], + 'integer_literal_case' => true, + 'modernize_strpos' => false, // requires 8.0+ + 'no_alternative_syntax' => ['fix_non_monolithic_code' => false], + 'no_space_around_double_colon' => true, + 'octal_notation' => false, // requires 8.1+ + 'string_length_to_empty' => true, ]; $options = [ diff --git a/system/Commands/Encryption/GenerateKey.php b/system/Commands/Encryption/GenerateKey.php index c43713efe893..810f2dc92d39 100644 --- a/system/Commands/Encryption/GenerateKey.php +++ b/system/Commands/Encryption/GenerateKey.php @@ -125,7 +125,7 @@ protected function setNewEncryptionKey(string $key, array $params): bool { $currentKey = env('encryption.key', ''); - if (strlen($currentKey) !== 0 && ! $this->confirmOverwrite($params)) { + if ($currentKey !== '' && ! $this->confirmOverwrite($params)) { // Not yet testable since it requires keyboard input // @codeCoverageIgnoreStart return false; diff --git a/system/Validation/CreditCardRules.php b/system/Validation/CreditCardRules.php index 8632dfc8f47e..9e18f4ef5cb9 100644 --- a/system/Validation/CreditCardRules.php +++ b/system/Validation/CreditCardRules.php @@ -189,7 +189,7 @@ public function valid_cc_number(?string $ccNumber, string $type): bool } // Make sure we have a valid length - if (strlen($ccNumber) === 0) { + if ((string) $ccNumber === '') { return false; }