From 989562252a413ad9c6b60c58fce702eb6fea9a26 Mon Sep 17 00:00:00 2001 From: David Badura Date: Mon, 6 Apr 2026 09:59:12 +0200 Subject: [PATCH] fix current key for subject id method --- phpstan-baseline.neon | 26 +------------------ .../ExtensionDoctrineCipherKeyStore.php | 2 +- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 8f4bd55e..3764a738 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -18,34 +18,10 @@ parameters: count: 1 path: src/Cryptography/DoctrineCipherKeyStore.php - - - message: '#^Offset ''crypto_iv'' does not exist on array\{id\: non\-empty\-string, subject_id\: non\-empty\-string, crypto_key\: non\-empty\-string, crypto_method\: non\-empty\-string, created_at\: non\-empty\-string\}\.$#' - identifier: offsetAccess.notFound - count: 1 - path: src/Cryptography/ExtensionDoctrineCipherKeyStore.php - - - - message: '#^Parameter \#1 \$string of function base64_decode expects string, mixed given\.$#' - identifier: argument.type - count: 1 - path: src/Cryptography/ExtensionDoctrineCipherKeyStore.php - - - - message: '#^Parameter \#2 \$subjectId of class Patchlevel\\Hydrator\\Extension\\Cryptography\\Cipher\\CipherKey constructor expects non\-empty\-string, string given\.$#' - identifier: argument.type - count: 1 - path: src/Cryptography/ExtensionDoctrineCipherKeyStore.php - - message: '#^Parameter \#3 \$key of class Patchlevel\\Hydrator\\Extension\\Cryptography\\Cipher\\CipherKey constructor expects non\-empty\-string, string given\.$#' identifier: argument.type - count: 1 - path: src/Cryptography/ExtensionDoctrineCipherKeyStore.php - - - - message: '#^Parameter \#4 \$method of class Patchlevel\\Hydrator\\Extension\\Cryptography\\Cipher\\CipherKey constructor expects non\-empty\-string, string given\.$#' - identifier: argument.type - count: 1 + count: 2 path: src/Cryptography/ExtensionDoctrineCipherKeyStore.php - diff --git a/src/Cryptography/ExtensionDoctrineCipherKeyStore.php b/src/Cryptography/ExtensionDoctrineCipherKeyStore.php index 8bb32131..2a8226fb 100644 --- a/src/Cryptography/ExtensionDoctrineCipherKeyStore.php +++ b/src/Cryptography/ExtensionDoctrineCipherKeyStore.php @@ -72,9 +72,9 @@ public function currentKeyFor(string $subjectId): CipherKey return new CipherKey( $result['id'], + $result['subject_id'], base64_decode($result['crypto_key']), $result['crypto_method'], - base64_decode($result['crypto_iv']), $this->dateTimeType->convertToPHPValue($result['created_at'], $this->connection->getDatabasePlatform()), ); }