From 249909381eef8fb0fe13353c11e42df5cbd5e491 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Tue, 26 Mar 2024 13:05:08 -0700 Subject: [PATCH 1/6] fix: remove contructor doc comments --- src/Client/MomentoClientFactory.php | 3 --- src/MomentoCacheBackend.php | 3 --- src/MomentoCacheBackendFactory.php | 3 --- 3 files changed, 9 deletions(-) diff --git a/src/Client/MomentoClientFactory.php b/src/Client/MomentoClientFactory.php index 39dfde7..9f8a136 100644 --- a/src/Client/MomentoClientFactory.php +++ b/src/Client/MomentoClientFactory.php @@ -54,9 +54,6 @@ class MomentoClientFactory { */ private $logFile; - /** - * MomentoClientFactory constructor. - */ public function __construct() { $settings = Settings::get('momento_cache', []); $authToken = array_key_exists('api_token', $settings) ? diff --git a/src/MomentoCacheBackend.php b/src/MomentoCacheBackend.php index 8c244f9..a5f4aaa 100644 --- a/src/MomentoCacheBackend.php +++ b/src/MomentoCacheBackend.php @@ -78,9 +78,6 @@ class MomentoCacheBackend implements CacheBackendInterface { */ private $logFile; - /** - * MomentoCacheBackend constructor. - */ public function __construct( $bin, $client, diff --git a/src/MomentoCacheBackendFactory.php b/src/MomentoCacheBackendFactory.php index 10a87ac..d295676 100644 --- a/src/MomentoCacheBackendFactory.php +++ b/src/MomentoCacheBackendFactory.php @@ -47,9 +47,6 @@ class MomentoCacheBackendFactory implements CacheFactoryInterface { */ private $backends = []; - /** - * MomentoCacheBackendFactory constructor. - */ public function __construct( MomentoClientFactory $momento_factory, CacheTagsChecksumInterface $checksum_provider From 37507461f472044a270dae68effb476bfa5a0ddc Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Tue, 26 Mar 2024 13:10:45 -0700 Subject: [PATCH 2/6] fix: add doc comments in form accepted by drupal.org --- src/Client/MomentoClientFactory.php | 3 +++ src/MomentoCacheBackend.php | 3 +++ src/MomentoCacheBackendFactory.php | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/Client/MomentoClientFactory.php b/src/Client/MomentoClientFactory.php index 9f8a136..8cda75c 100644 --- a/src/Client/MomentoClientFactory.php +++ b/src/Client/MomentoClientFactory.php @@ -54,6 +54,9 @@ class MomentoClientFactory { */ private $logFile; + /** + * Constructs a new MomentoClientFactory. + */ public function __construct() { $settings = Settings::get('momento_cache', []); $authToken = array_key_exists('api_token', $settings) ? diff --git a/src/MomentoCacheBackend.php b/src/MomentoCacheBackend.php index a5f4aaa..52cc1df 100644 --- a/src/MomentoCacheBackend.php +++ b/src/MomentoCacheBackend.php @@ -78,6 +78,9 @@ class MomentoCacheBackend implements CacheBackendInterface { */ private $logFile; + /** + * Constructs a new MomentoCacheBackend object. + */ public function __construct( $bin, $client, diff --git a/src/MomentoCacheBackendFactory.php b/src/MomentoCacheBackendFactory.php index d295676..a8bad64 100644 --- a/src/MomentoCacheBackendFactory.php +++ b/src/MomentoCacheBackendFactory.php @@ -47,6 +47,9 @@ class MomentoCacheBackendFactory implements CacheFactoryInterface { */ private $backends = []; + /** + * Constructs a new MomentoCacheBackendFactory. + */ public function __construct( MomentoClientFactory $momento_factory, CacheTagsChecksumInterface $checksum_provider From 081235660213a8d06c0f3289b7e822974f365830 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Tue, 26 Mar 2024 13:17:14 -0700 Subject: [PATCH 3/6] fix: add class namespace to constructor comment --- src/Client/MomentoClientFactory.php | 2 +- src/MomentoCacheBackend.php | 2 +- src/MomentoCacheBackendFactory.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Client/MomentoClientFactory.php b/src/Client/MomentoClientFactory.php index 8cda75c..c74b79c 100644 --- a/src/Client/MomentoClientFactory.php +++ b/src/Client/MomentoClientFactory.php @@ -55,7 +55,7 @@ class MomentoClientFactory { private $logFile; /** - * Constructs a new MomentoClientFactory. + * Constructs a new \Drupal\momento_cache\Client\MomentoClientFactory object. */ public function __construct() { $settings = Settings::get('momento_cache', []); diff --git a/src/MomentoCacheBackend.php b/src/MomentoCacheBackend.php index 52cc1df..3b89b8c 100644 --- a/src/MomentoCacheBackend.php +++ b/src/MomentoCacheBackend.php @@ -79,7 +79,7 @@ class MomentoCacheBackend implements CacheBackendInterface { private $logFile; /** - * Constructs a new MomentoCacheBackend object. + * Constructs a new Drupal\momento_cache\MomentoCacheBackend object. */ public function __construct( $bin, diff --git a/src/MomentoCacheBackendFactory.php b/src/MomentoCacheBackendFactory.php index a8bad64..53506a2 100644 --- a/src/MomentoCacheBackendFactory.php +++ b/src/MomentoCacheBackendFactory.php @@ -48,8 +48,8 @@ class MomentoCacheBackendFactory implements CacheFactoryInterface { private $backends = []; /** - * Constructs a new MomentoCacheBackendFactory. - */ + * Constructs a new \Drupal\momento_cache\MomentoCacheBackendFactory object. + */ public function __construct( MomentoClientFactory $momento_factory, CacheTagsChecksumInterface $checksum_provider From a0dadad9bda6ff37d3b9dd6345a4c3b782d73186 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Tue, 26 Mar 2024 13:19:08 -0700 Subject: [PATCH 4/6] fix: add class namespace to constructor comment --- src/MomentoCacheBackendFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MomentoCacheBackendFactory.php b/src/MomentoCacheBackendFactory.php index 53506a2..0bf64f1 100644 --- a/src/MomentoCacheBackendFactory.php +++ b/src/MomentoCacheBackendFactory.php @@ -49,7 +49,7 @@ class MomentoCacheBackendFactory implements CacheFactoryInterface { /** * Constructs a new \Drupal\momento_cache\MomentoCacheBackendFactory object. - */ + */ public function __construct( MomentoClientFactory $momento_factory, CacheTagsChecksumInterface $checksum_provider From 2cdbc233439d2bc99438f2606daced579d62fc20 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Tue, 26 Mar 2024 13:22:37 -0700 Subject: [PATCH 5/6] fix: function and method declarations on a single line --- src/MomentoCacheBackend.php | 6 +----- src/MomentoCacheBackendFactory.php | 18 +++++++----------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/MomentoCacheBackend.php b/src/MomentoCacheBackend.php index 3b89b8c..844fbf4 100644 --- a/src/MomentoCacheBackend.php +++ b/src/MomentoCacheBackend.php @@ -81,11 +81,7 @@ class MomentoCacheBackend implements CacheBackendInterface { /** * Constructs a new Drupal\momento_cache\MomentoCacheBackend object. */ - public function __construct( - $bin, - $client, - CacheTagsChecksumInterface $checksum_provider - ) { + public function __construct($bin, $client, CacheTagsChecksumInterface $checksum_provider) { $this->maxTtl = intdiv(PHP_INT_MAX, 1000); $this->client = $client; $this->bin = $bin; diff --git a/src/MomentoCacheBackendFactory.php b/src/MomentoCacheBackendFactory.php index 0bf64f1..5e02126 100644 --- a/src/MomentoCacheBackendFactory.php +++ b/src/MomentoCacheBackendFactory.php @@ -50,17 +50,13 @@ class MomentoCacheBackendFactory implements CacheFactoryInterface { /** * Constructs a new \Drupal\momento_cache\MomentoCacheBackendFactory object. */ - public function __construct( - MomentoClientFactory $momento_factory, - CacheTagsChecksumInterface $checksum_provider - ) { - $this->momentoFactory = $momento_factory; - $this->checksumProvider = $checksum_provider; - $this->client = $this->momentoFactory->get(); - $settings = Settings::get('momento_cache', []); - static::$cacheName = array_key_exists('cache_name', $settings) ? - $settings['cache_name'] : getenv("MOMENTO_CACHE_NAME"); - } + public function __construct(MomentoClientFactory $momento_factory, CacheTagsChecksumInterface $checksum_provider) { + $this->momentoFactory = $momento_factory; + $this->checksumProvider = $checksum_provider; + $this->client = $this->momentoFactory->get(); + $settings = Settings::get('momento_cache', []); + static::$cacheName = array_key_exists('cache_name', $settings) ? $settings['cache_name'] : getenv("MOMENTO_CACHE_NAME"); + } /** * Gets the configured cache name. From 2e234e0c01b6d190fbed409ac199dad91b486c89 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Tue, 26 Mar 2024 13:27:24 -0700 Subject: [PATCH 6/6] fix: update MomentoCacheBackendFactory.php --- src/MomentoCacheBackendFactory.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/MomentoCacheBackendFactory.php b/src/MomentoCacheBackendFactory.php index 5e02126..1a54380 100644 --- a/src/MomentoCacheBackendFactory.php +++ b/src/MomentoCacheBackendFactory.php @@ -50,13 +50,13 @@ class MomentoCacheBackendFactory implements CacheFactoryInterface { /** * Constructs a new \Drupal\momento_cache\MomentoCacheBackendFactory object. */ - public function __construct(MomentoClientFactory $momento_factory, CacheTagsChecksumInterface $checksum_provider) { - $this->momentoFactory = $momento_factory; - $this->checksumProvider = $checksum_provider; - $this->client = $this->momentoFactory->get(); - $settings = Settings::get('momento_cache', []); - static::$cacheName = array_key_exists('cache_name', $settings) ? $settings['cache_name'] : getenv("MOMENTO_CACHE_NAME"); - } + public function __construct(MomentoClientFactory $momento_factory, CacheTagsChecksumInterface $checksum_provider) { + $this->momentoFactory = $momento_factory; + $this->checksumProvider = $checksum_provider; + $this->client = $this->momentoFactory->get(); + $settings = Settings::get('momento_cache', []); + static::$cacheName = array_key_exists('cache_name', $settings) ? $settings['cache_name'] : getenv("MOMENTO_CACHE_NAME"); + } /** * Gets the configured cache name.