From f34f0340c063f14481c5431467a411f6cf30a714 Mon Sep 17 00:00:00 2001 From: Samuel Nogueira Date: Thu, 2 Nov 2023 15:29:18 +0000 Subject: [PATCH] Add missing PHPDoc annotation for Doctrine Cache implementations This fixes the following deprecations produced by Symfony: * User Deprecated: Method "Doctrine\Common\Cache\Cache::fetch()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Aws\DoctrineCacheAdapter" now to avoid errors or add an explicit @return annotation to suppress this message. * User Deprecated: Method "Doctrine\Common\Cache\Cache::save()" might add "bool" as a native return type declaration in the future. Do the same in implementation "Aws\DoctrineCacheAdapter" now to avoid errors or add an explicit @return annotation to suppress this message. * User Deprecated: Method "Doctrine\Common\Cache\Cache::delete()" might add "bool" as a native return type declaration in the future. Do the same in implementation "Aws\DoctrineCacheAdapter" now to avoid errors or add an explicit @return annotation to suppress this message. * User Deprecated: Method "Doctrine\Common\Cache\Cache::contains()" might add "bool" as a native return type declaration in the future. Do the same in implementation "Aws\DoctrineCacheAdapter" now to avoid errors or add an explicit @return annotation to suppress this message. * User Deprecated: Method "Doctrine\Common\Cache\Cache::getStats()" might add "?array" as a native return type declaration in the future. Do the same in implementation "Aws\DoctrineCacheAdapter" now to avoid errors or add an explicit @return annotation to suppress this message. --- .../enhancement-add-phpdoc-doctrine-cache | 7 +++++++ src/DoctrineCacheAdapter.php | 15 +++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 .changes/nextrelease/enhancement-add-phpdoc-doctrine-cache diff --git a/.changes/nextrelease/enhancement-add-phpdoc-doctrine-cache b/.changes/nextrelease/enhancement-add-phpdoc-doctrine-cache new file mode 100644 index 0000000000..c7fed98eef --- /dev/null +++ b/.changes/nextrelease/enhancement-add-phpdoc-doctrine-cache @@ -0,0 +1,7 @@ +[ + { + "type": "enhancement", + "category": "", + "description": "Add missing PHPDoc annotation for Doctrine Cache implementations." + } +] diff --git a/src/DoctrineCacheAdapter.php b/src/DoctrineCacheAdapter.php index 132a347feb..5540745c08 100644 --- a/src/DoctrineCacheAdapter.php +++ b/src/DoctrineCacheAdapter.php @@ -18,6 +18,9 @@ public function get($key) return $this->cache->fetch($key); } + /** + * @return mixed + */ public function fetch($key) { return $this->get($key); @@ -28,6 +31,9 @@ public function set($key, $value, $ttl = 0) return $this->cache->save($key, $value, $ttl); } + /** + * @return bool + */ public function save($key, $value, $ttl = 0) { return $this->set($key, $value, $ttl); @@ -38,16 +44,25 @@ public function remove($key) return $this->cache->delete($key); } + /** + * @return bool + */ public function delete($key) { return $this->remove($key); } + /** + * @return bool + */ public function contains($key) { return $this->cache->contains($key); } + /** + * @return mixed[]|null + */ public function getStats() { return $this->cache->getStats();