Skip to content

Commit 1d0b565

Browse files
authored
chore: add rule nullable_type_declaration_for_default_null_value (#227)
1 parent e8630cb commit 1d0b565

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

.php-cs-fixer.php

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,22 @@
2828
'@all'
2929
]
3030
],
31-
'no_php4_constructor' => true,
32-
'no_superfluous_phpdoc_tags' => false,
33-
'no_unreachable_default_argument_value' => true,
34-
'no_useless_else' => true,
35-
'no_useless_return' => true,
36-
'ordered_imports' => true,
37-
'php_unit_strict' => true,
38-
'phpdoc_order' => true,
39-
'semicolon_after_instruction' => true,
40-
'single_import_per_statement' => false,
41-
'strict_comparison' => true,
42-
'strict_param' => true,
43-
'single_line_throw' => false,
44-
'trailing_comma_in_multiline' => false,
45-
'yoda_style' => [
31+
'no_php4_constructor' => true,
32+
'no_superfluous_phpdoc_tags' => false,
33+
'no_unreachable_default_argument_value' => true,
34+
'no_useless_else' => true,
35+
'no_useless_return' => true,
36+
'nullable_type_declaration_for_default_null_value' => true,
37+
'ordered_imports' => true,
38+
'php_unit_strict' => true,
39+
'phpdoc_order' => true,
40+
'semicolon_after_instruction' => true,
41+
'single_import_per_statement' => false,
42+
'strict_comparison' => true,
43+
'strict_param' => true,
44+
'single_line_throw' => false,
45+
'trailing_comma_in_multiline' => false,
46+
'yoda_style' => [
4647
'equal' => false,
4748
'identical' => false,
4849
'less_and_greater' => false

src/DriverManager.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static function useDefaultDriver(): void
4848
*
4949
* @throws SessionException
5050
*/
51-
public static function useDefaultEncryptionDriver(string $key, string $method = null): void
51+
public static function useDefaultEncryptionDriver(string $key, ?string $method = null): void
5252
{
5353
static::throwExceptionIfHasStarted();
5454

@@ -74,7 +74,7 @@ public static function useFileDriver(): void
7474
*
7575
* @throws SessionException
7676
*/
77-
public static function useFileEncryptionDriver(string $key, string $method = null): void
77+
public static function useFileEncryptionDriver(string $key, ?string $method = null): void
7878
{
7979
static::throwExceptionIfHasStarted();
8080

@@ -189,7 +189,7 @@ public static function useCurrentRedisDriver(PredisClient $redisInstance): void
189189
*
190190
* @throws SessionException
191191
*/
192-
public static function useNewRedisEncryptionDriver($configuration, string $key, string $method = null): void
192+
public static function useNewRedisEncryptionDriver($configuration, string $key, ?string $method = null): void
193193
{
194194
static::throwExceptionIfHasStarted();
195195

@@ -208,7 +208,7 @@ public static function useNewRedisEncryptionDriver($configuration, string $key,
208208
*
209209
* @throws SessionException
210210
*/
211-
public static function useCurrentRedisEncryptionDriver(PredisClient $redisInstance, string $key, string $method = null): void // phpcs:ignore
211+
public static function useCurrentRedisEncryptionDriver(PredisClient $redisInstance, string $key, ?string $method = null): void // phpcs:ignore
212212
{
213213
static::throwExceptionIfHasStarted();
214214

tests/EncryptionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function testExceptionMethodForced(): void
6969
'aes-256-cbc-hmac-sha1'
7070
];
7171

72-
$encryptionTrait = new class() {
72+
$encryptionTrait = new class {
7373
use \Rancoud\Session\Encryption;
7474

7575
public function setMethod(string $method): void

0 commit comments

Comments
 (0)