From 72cb5a41eb5177d478f4c122cd7daf32b486ccf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rancoud?= Date: Thu, 24 Apr 2025 02:39:31 +0200 Subject: [PATCH] chore: remove comments about phpcs --- .gitattributes | 1 - .php-cs-fixer.php | 2 +- src/Database.php | 8 ++++---- src/DriverManager.php | 4 ++-- src/Encryption.php | 2 +- src/File.php | 2 +- src/Redis.php | 2 +- 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.gitattributes b/.gitattributes index 652a875..f69d363 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12,5 +12,4 @@ Dockerfile linguist-detectable=false /Dockerfile export-ignore /docker-compose.yml export-ignore /entrypoint.sh export-ignore -/phpcs.xml export-ignore /phpunit.xml export-ignore diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 688a26a..0b39c42 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -111,7 +111,7 @@ 'no_empty_comment' => true, 'no_trailing_whitespace_in_comment' => true, 'single_line_comment_spacing' => true, - 'single_line_comment_style' => ['comment_types' => ['asterisk', 'hash']] + 'single_line_comment_style' => ['comment_types' => ['hash']] ]; $constantNotationRules = [ diff --git a/src/Database.php b/src/Database.php index 2acc73c..1417e8e 100644 --- a/src/Database.php +++ b/src/Database.php @@ -91,7 +91,7 @@ public function write(string $id, string $data): bool return true; } catch (DatabaseException $e) { - throw new SessionException('could not update session: ' . $e->getMessage(), $e->getCode(), $e->getPrevious()); // phpcs:ignore + throw new SessionException('could not update session: ' . $e->getMessage(), $e->getCode(), $e->getPrevious()); } } @@ -105,7 +105,7 @@ public function destroy(string $id): bool return true; } catch (DatabaseException $e) { - throw new SessionException('could not delete session: ' . $e->getMessage(), $e->getCode(), $e->getPrevious()); // phpcs:ignore + throw new SessionException('could not delete session: ' . $e->getMessage(), $e->getCode(), $e->getPrevious()); } } @@ -120,7 +120,7 @@ public function gc(int $max_lifetime): bool return true; } catch (DatabaseException $e) { - throw new SessionException('could not clean old sessions: ' . $e->getMessage(), $e->getCode(), $e->getPrevious()); // phpcs:ignore + throw new SessionException('could not clean old sessions: ' . $e->getMessage(), $e->getCode(), $e->getPrevious()); } } @@ -161,7 +161,7 @@ public function updateTimestamp(string $id, string $data): bool * * @noinspection PhpMethodNamingConventionInspection */ - public function create_sid(): string // phpcs:ignore + public function create_sid(): string { try { $string = ''; diff --git a/src/DriverManager.php b/src/DriverManager.php index 97e5100..bcc3378 100644 --- a/src/DriverManager.php +++ b/src/DriverManager.php @@ -98,7 +98,7 @@ public static function useNewDatabaseEncryptionDriver(array|Configurator $config } /** @throws SessionException */ - public static function useCurrentDatabaseEncryptionDriver(DB $databaseInstance, string $key, ?string $method = null): void // phpcs:ignore + public static function useCurrentDatabaseEncryptionDriver(DB $databaseInstance, string $key, ?string $method = null): void { static::throwExceptionIfHasStarted(); @@ -147,7 +147,7 @@ public static function useNewRedisEncryptionDriver(array|string $configuration, } /** @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 { static::throwExceptionIfHasStarted(); diff --git a/src/Encryption.php b/src/Encryption.php index 8bf8807..863f602 100644 --- a/src/Encryption.php +++ b/src/Encryption.php @@ -153,7 +153,7 @@ public function encrypt(string $data): string /** @noinspection CryptographicallySecureRandomnessInspection */ $iv = \openssl_random_pseudo_bytes($length, $cstrong); - // @noinspection PhpStrictComparisonWithOperandsOfDifferentTypesInspection + /** @noinspection PhpStrictComparisonWithOperandsOfDifferentTypesInspection */ if ($iv === false || $cstrong === false) { // @codeCoverageIgnoreStart // Could not reach this statement without mocking the function diff --git a/src/File.php b/src/File.php index 5a6f81a..b778896 100644 --- a/src/File.php +++ b/src/File.php @@ -115,7 +115,7 @@ public function updateTimestamp(string $id, string $data): bool * * @noinspection PhpMethodNamingConventionInspection */ - public function create_sid(): string // phpcs:ignore + public function create_sid(): string { $string = ''; $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-'; diff --git a/src/Redis.php b/src/Redis.php index dab0733..03a5221 100644 --- a/src/Redis.php +++ b/src/Redis.php @@ -103,7 +103,7 @@ public function updateTimestamp(string $id, string $data): bool * * @noinspection PhpMethodNamingConventionInspection */ - public function create_sid(): string // phpcs:ignore + public function create_sid(): string { $string = ''; $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-';