From aa073b3e518df154d2f6c6626d8122a6f90619be Mon Sep 17 00:00:00 2001 From: Pete Gautier Date: Thu, 12 Oct 2023 15:47:30 -0700 Subject: [PATCH] fix: fix array to string error --- .github/workflows/on-pull-request.yml | 1 + src/MomentoCacheBackend.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/on-pull-request.yml b/.github/workflows/on-pull-request.yml index c1f9914..d7eaa59 100644 --- a/.github/workflows/on-pull-request.yml +++ b/.github/workflows/on-pull-request.yml @@ -46,6 +46,7 @@ jobs: php-version: '${{ matrix.php-version }}' extensions: grpc tools: composer:v2 + ini-values: zend.assertions=1 # The next two steps exposes $DRUPAL_ROOT and $MODULE_FOLDER environment # variables. diff --git a/src/MomentoCacheBackend.php b/src/MomentoCacheBackend.php index 03b5134..00b53de 100644 --- a/src/MomentoCacheBackend.php +++ b/src/MomentoCacheBackend.php @@ -135,6 +135,7 @@ public function set($cid, $data, $expire = CacheBackendInterface::CACHE_PERMANEN $ttl = $this->MAX_TTL; $item = new \stdClass(); $item->cid = $cid; +// $item->tags = implode(' ', $tags); $item->tags = $tags; $item->data = $data; $item->created = round(microtime(TRUE), 3); @@ -178,11 +179,12 @@ public function setMultiple(array $items) public function delete($cid) { - // TODO: remove this cid from tags sets? would require fetching the item and accessing the tags. $this->getLogger('momento_cache')->debug("DELETE cid $cid from bin $this->bin"); $deleteResponse = $this->client->delete($this->cacheName, $cid); if ($deleteResponse->asError()) { - $this->getLogger('momento_cache')->error("DELETE response error for $cid in bin $this->bin: " . $deleteResponse->asError()->message()); + $this->getLogger('momento_cache')->error( + "DELETE response error for $cid in bin $this->bin: " . $deleteResponse->asError()->message() + ); } else { $this->getLogger('momento_cache')->debug("DELETED $cid from bin $this->bin"); }