Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add rule nullable_type_declaration_for_default_null_value #227

Merged
merged 1 commit into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,22 @@
'@all'
]
],
'no_php4_constructor' => true,
'no_superfluous_phpdoc_tags' => false,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_imports' => true,
'php_unit_strict' => true,
'phpdoc_order' => true,
'semicolon_after_instruction' => true,
'single_import_per_statement' => false,
'strict_comparison' => true,
'strict_param' => true,
'single_line_throw' => false,
'trailing_comma_in_multiline' => false,
'yoda_style' => [
'no_php4_constructor' => true,
'no_superfluous_phpdoc_tags' => false,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'nullable_type_declaration_for_default_null_value' => true,
'ordered_imports' => true,
'php_unit_strict' => true,
'phpdoc_order' => true,
'semicolon_after_instruction' => true,
'single_import_per_statement' => false,
'strict_comparison' => true,
'strict_param' => true,
'single_line_throw' => false,
'trailing_comma_in_multiline' => false,
'yoda_style' => [
'equal' => false,
'identical' => false,
'less_and_greater' => false
Expand Down
8 changes: 4 additions & 4 deletions src/DriverManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static function useDefaultDriver(): void
*
* @throws SessionException
*/
public static function useDefaultEncryptionDriver(string $key, string $method = null): void
public static function useDefaultEncryptionDriver(string $key, ?string $method = null): void
{
static::throwExceptionIfHasStarted();

Expand All @@ -74,7 +74,7 @@ public static function useFileDriver(): void
*
* @throws SessionException
*/
public static function useFileEncryptionDriver(string $key, string $method = null): void
public static function useFileEncryptionDriver(string $key, ?string $method = null): void
{
static::throwExceptionIfHasStarted();

Expand Down Expand Up @@ -189,7 +189,7 @@ public static function useCurrentRedisDriver(PredisClient $redisInstance): void
*
* @throws SessionException
*/
public static function useNewRedisEncryptionDriver($configuration, string $key, string $method = null): void
public static function useNewRedisEncryptionDriver($configuration, string $key, ?string $method = null): void
{
static::throwExceptionIfHasStarted();

Expand All @@ -208,7 +208,7 @@ public static function useNewRedisEncryptionDriver($configuration, string $key,
*
* @throws SessionException
*/
public static function useCurrentRedisEncryptionDriver(PredisClient $redisInstance, string $key, string $method = null): void // phpcs:ignore
public static function useCurrentRedisEncryptionDriver(PredisClient $redisInstance, string $key, ?string $method = null): void // phpcs:ignore
{
static::throwExceptionIfHasStarted();

Expand Down
2 changes: 1 addition & 1 deletion tests/EncryptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function testExceptionMethodForced(): void
'aes-256-cbc-hmac-sha1'
];

$encryptionTrait = new class() {
$encryptionTrait = new class {
use \Rancoud\Session\Encryption;

public function setMethod(string $method): void
Expand Down
Loading