From 7bd13f27974b76125cf31aa89049d605146ce167 Mon Sep 17 00:00:00 2001 From: rishtigupta <127137312+rishtigupta@users.noreply.github.com> Date: Tue, 19 Mar 2024 13:48:59 -0700 Subject: [PATCH] chore: add DrupalPractice as a phpcs standard (#31) --- .github/workflows/on-pull-request.yml | 2 +- src/MomentoCacheBackend.php | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/on-pull-request.yml b/.github/workflows/on-pull-request.yml index c01ba70..d419bc2 100644 --- a/.github/workflows/on-pull-request.yml +++ b/.github/workflows/on-pull-request.yml @@ -124,7 +124,7 @@ jobs: - name: Run PHPCS working-directory: ${{ env.DRUPAL_ROOT }} run: | - vendor/bin/phpcs $MODULE_FOLDER --standard=Drupal \ + vendor/bin/phpcs $MODULE_FOLDER --standard=Drupal,DrupalPractice \ --extensions=php,module,inc,install,test,info - name: Start Drush webserver and chromedriver diff --git a/src/MomentoCacheBackend.php b/src/MomentoCacheBackend.php index 09f872f..8c244f9 100644 --- a/src/MomentoCacheBackend.php +++ b/src/MomentoCacheBackend.php @@ -130,7 +130,14 @@ public function getMultiple(&$cids, $allow_invalid = FALSE) { foreach ($futures as $cid => $future) { $getResponse = $future->wait(); if ($getResponse->asHit()) { - $result = unserialize($getResponse->asHit()->valueString()); + $result = unserialize( + $getResponse->asHit()->valueString(), + [ + 'allowed_classes' => [ + \stdClass::class, + ], + ] + ); if ($result->created <= $this->lastBinDeletionTime) { continue;