From 796b2dac071720ec120342e83f151ee3dafdb6ba Mon Sep 17 00:00:00 2001 From: Massimo Infunti Date: Fri, 23 May 2025 22:04:56 +0200 Subject: [PATCH 1/2] corrections for cake5.x --- src/Database/Type/EncryptType.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Database/Type/EncryptType.php b/src/Database/Type/EncryptType.php index f75bf11..e9a22f3 100644 --- a/src/Database/Type/EncryptType.php +++ b/src/Database/Type/EncryptType.php @@ -22,7 +22,8 @@ class EncryptType extends BaseType * @param Driver $driver * @return mixed|string|null */ - public function toDatabase($value, DriverInterface $driver){ + public function toDatabase($value, \Cake\Database\Driver $driver): mixed + { if ($value === null) { return null; @@ -48,7 +49,8 @@ public function toDatabase($value, DriverInterface $driver){ * @param Driver $driver * @return mixed|string|null */ - public function toPHP($value, DriverInterface $driver){ + public function toPHP($value, \Cake\Database\Driver $driver): mixed + { if ($value === null) { return null; } @@ -59,7 +61,7 @@ public function toPHP($value, DriverInterface $driver){ * @param $value * @return mixed */ - public function marshal($value) + public function marshal($value): mixed { if ($value === null) { return null; @@ -77,7 +79,7 @@ public function marshal($value) * @param Driver $driver * @return int|mixed */ - public function toStatement($value, DriverInterface $driver) + public function toStatement($value, \Cake\Database\Driver $driver): int { if ($value === null) { return PDO::PARAM_NULL; @@ -85,5 +87,4 @@ public function toStatement($value, DriverInterface $driver) return PDO::PARAM_STR; } - } From 76eb3e32ca5d51bfc91b6744e6dafbbb8d99aef8 Mon Sep 17 00:00:00 2001 From: Massimo Infunti Date: Fri, 23 May 2025 22:13:29 +0200 Subject: [PATCH 2/2] corrections to README for cake5.1 --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 195eab9..195ef52 100644 --- a/README.md +++ b/README.md @@ -64,12 +64,17 @@ class AccountsTable extends Table * @param TableSchemaInterface $schema * @return TableSchemaInterface */ - protected function _initializeSchema(TableSchemaInterface $schema): TableSchemaInterface + public function initialize(array $config): void { - $schema->setColumnType('account_number', 'encrypted'); - $schema->setColumnType('email', 'encrypted'); + + parent::initialize($config); + + //... rest of initialization + + $this->getSchema()->setColumnType('account_number', 'encrypted'); + $this->getSchema()->setColumnType('email', 'encrypted'); + - return $schema; } } ```