From 8606a00a05298646edbfca2940c6a1f75361c6c8 Mon Sep 17 00:00:00 2001 From: Damiano Improta Date: Fri, 9 Jan 2026 14:44:43 +0100 Subject: [PATCH 01/19] Redis and memcache cache, instance passed in construction --- src/Service/MemcacheCache.php | 39 +++++++++++++++++++++++------------ src/Service/RedisCache.php | 34 +++++++++++++++++++++--------- tests/MemcacheCacheTest.php | 23 +++++++++++++++++---- tests/RedisCacheTest.php | 19 ++++++++++++++++- 4 files changed, 87 insertions(+), 28 deletions(-) diff --git a/src/Service/MemcacheCache.php b/src/Service/MemcacheCache.php index 4dbee59..e88bb27 100644 --- a/src/Service/MemcacheCache.php +++ b/src/Service/MemcacheCache.php @@ -3,7 +3,9 @@ namespace CacheMultiLayer\Service; use CacheMultiLayer\Enum\CacheEnum; +use CacheMultiLayer\Exception\CacheMissingConfigurationException; use CacheMultiLayer\Interface\Cacheable; +use Exception; use Memcache; use Override; @@ -13,6 +15,7 @@ */ class MemcacheCache extends Cache { + /** * * {@inheritDoc} @@ -165,26 +168,36 @@ public function set(string $key, int|float|string|Cacheable|array $val, ?int $tt protected function __construct(int $ttl, array $configuration = []) { parent::__construct($ttl, $configuration); - $this->memcache = new Memcache(); - $port = $configuration['port'] ?? 11211; - if (array_key_exists('persistent', $configuration)) { - $resultConnection = $this->memcache->pconnect($configuration['server_address'], $port); + if (array_key_exists('instance', $configuration)) { + $this->memcache = $configuration['instance']; } else { - $resultConnection = $this->memcache->connect($configuration['server_address'], $port); - } - - if (!$resultConnection) { - throw new \Exception("Connection not found"); + $this->memcache = new Memcache(); + $port = $configuration['port'] ?? 11211; + if (array_key_exists('persistent', $configuration)) { + $resultConnection = $this->memcache->pconnect($configuration['server_address'], $port); + } else { + $resultConnection = $this->memcache->connect($configuration['server_address'], $port); + } + + if (!$resultConnection) { + throw new Exception("Connection not found"); + } } - $this->compress = array_key_exists('compress', $configuration) && $configuration['compress']; } + #[\Override] + protected function assertConfig(array $configuration): void + { + if (!array_key_exists('instance', $configuration) || $configuration['instance'] instanceof Memcache) { + parent::assertConfig($configuration); + } else if (array_key_exists('instance', $configuration)) { + throw new CacheMissingConfigurationException("instance must be " . Memcache::class . " class"); + } + } private readonly Memcache $memcache; - private readonly bool $compress; - private array $mandatoryKeys = [ 'server_address' ]; -} +} \ No newline at end of file diff --git a/src/Service/RedisCache.php b/src/Service/RedisCache.php index d54adb5..a07b6bb 100644 --- a/src/Service/RedisCache.php +++ b/src/Service/RedisCache.php @@ -3,6 +3,7 @@ namespace CacheMultiLayer\Service; use CacheMultiLayer\Enum\CacheEnum; +use CacheMultiLayer\Exception\CacheMissingConfigurationException; use CacheMultiLayer\Interface\Cacheable; use Override; use Predis\Client as PredisClient; @@ -14,6 +15,7 @@ */ class RedisCache extends Cache { + /** * * {@InheritDoc} @@ -109,14 +111,18 @@ public function getRemainingTTL(string $key): ?int protected function __construct(int $ttl, array $configuration = []) { parent::__construct($ttl, $configuration); - $this->predisClient = new PredisClient([ - 'scheme' => $configuration['tcp'] ?? 'tcp', - 'host' => $configuration['server_address'], - 'port' => $configuration['port'] ?? 6379, - 'password' => $configuration['password'] ?? '', - 'database' => $configuration['database'] ?? 0, - 'persistent' => $configuration['persistent'] ?? false - ]); + if (array_key_exists('instance', $configuration)) { + $this->predisClient = $configuration['instance']; + } else { + $this->predisClient = new PredisClient([ + 'scheme' => $configuration['tcp'] ?? 'tcp', + 'host' => $configuration['server_address'], + 'port' => $configuration['port'] ?? 6379, + 'password' => $configuration['password'] ?? '', + 'database' => $configuration['database'] ?? 0, + 'persistent' => $configuration['persistent'] ?? false + ]); + } } /** @@ -149,9 +155,17 @@ protected function getMandatoryConfig(): array return $this->mandatoryKeys; } + #[\Override] + protected function assertConfig(array $configuration): void + { + if (!array_key_exists('instance', $configuration) || $configuration['instance'] instanceof PredisClient) { + parent::assertConfig($configuration); + } else if (array_key_exists('instance', $configuration)) { + throw new CacheMissingConfigurationException("instance must be " . PredisClient::class . " class"); + } + } private readonly PredisClient $predisClient; - private array $mandatoryKeys = [ 'server_address' ]; -} +} \ No newline at end of file diff --git a/tests/MemcacheCacheTest.php b/tests/MemcacheCacheTest.php index 48b690c..8864fc5 100644 --- a/tests/MemcacheCacheTest.php +++ b/tests/MemcacheCacheTest.php @@ -6,6 +6,7 @@ use CacheMultiLayer\Exception\CacheMissingConfigurationException; use CacheMultiLayer\Service\Cache; use Exception; +use Memcache; use Override; /** @@ -26,7 +27,7 @@ protected function setUp(): void #[Override] public static function setUpBeforeClass(): void { - parent::setUpBeforeClass(); + parent::setUpBeforeClass(); set_error_handler(function (int $errno, string $errstr, string $errfile, int $errline): bool { // error was suppressed with the @-operator if (0 === error_reporting()) { @@ -101,7 +102,7 @@ public function testIsConnected(): void { parent::testIsConnected(); } - + #[\Override] public function testEmptyDecrement(): void { @@ -132,6 +133,20 @@ public function testConnectionNotFound(): void Cache::factory(CacheEnum::MEMCACHE, 60, ['server_address' => 'ip-no-memcache'])->isConnected(); } + public function testInstance(): void + { + $memcache = new Memcache(); + $memcache->connect('memcache-server', 11211); + Cache::factory(CacheEnum::MEMCACHE, 60, ['instance' => $memcache]); + $this->assertTrue(true); //no exception throwns + } + + public function testMissingInstance(): void + { + $this->expectException(CacheMissingConfigurationException::class); + Cache::factory(CacheEnum::MEMCACHE, 60, ['instance' => 5]); + } + public function testEnum(): void { $this->doTestRealEnum(CacheEnum::MEMCACHE); @@ -140,7 +155,7 @@ public function testEnum(): void #[\Override] public static function tearDownAfterClass(): void { - restore_error_handler(); + restore_error_handler(); Cache::factory(CacheEnum::MEMCACHE, 60, ['server_address' => 'memcache-server'])->clearAllCache(); } -} +} \ No newline at end of file diff --git a/tests/RedisCacheTest.php b/tests/RedisCacheTest.php index 342569e..af9d235 100644 --- a/tests/RedisCacheTest.php +++ b/tests/RedisCacheTest.php @@ -7,6 +7,7 @@ use CacheMultiLayer\Service\Cache; use Exception; use Override; +use Predis\Client; /** * REDIS unit test class implementation @@ -139,10 +140,26 @@ public function testConnectionPersistent(): void $this->assertTrue(Cache::factory(CacheEnum::REDIS, 60, ['server_address' => 'redis-server', 'persistent' => true])->isConnected()); } + public function testInstance(): void + { + $redis = new Client([ + 'host' => 'redis-server', + 'port' => 6379 + ]); + Cache::factory(CacheEnum::REDIS, 60, ['instance' => $redis]); + $this->assertTrue(true); //no exception throwns + } + + public function testMissingInstance(): void + { + $this->expectException(CacheMissingConfigurationException::class); + Cache::factory(CacheEnum::REDIS, 60, ['instance' => 5]); + } + #[\Override] public static function tearDownAfterClass(): void { restore_error_handler(); Cache::factory(CacheEnum::REDIS, 60, ['server_address' => 'redis-server'])->clearAllCache(); } -} +} \ No newline at end of file From 8910c54cf69a3e0c1e1b0ddaa79db1eb4458542b Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 9 Jan 2026 13:46:16 +0000 Subject: [PATCH 02/19] chore: update CHANGELOG for PR #32 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13a2bfc..64be03c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,3 +14,5 @@ - [2025-12-22] DamImpr: Add tests directory to export-ignore in .gitattributes [#30](https://github.com/DamImpr/cache-multi-layer/pull/30) - [2026-01-05] DamImpr: add persistent connection redis [#31](https://github.com/DamImpr/cache-multi-layer/pull/31) + +- [2026-01-09] DamImpr: Redis and memcache cache, instance passed in construction [#32](https://github.com/DamImpr/cache-multi-layer/pull/32) From 6b50a0595c1cc189f7e79baf8b5470ef7fc0c4d2 Mon Sep 17 00:00:00 2001 From: Damiano Improta Date: Fri, 9 Jan 2026 14:47:28 +0100 Subject: [PATCH 03/19] update dipendenze --- composer.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.lock b/composer.lock index 3c00181..7622f29 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8310aaaf271b37ba5c613ac8d3130f08", + "content-hash": "05124d3fe3285b80707ceb8bdc9ab05b", "packages": [ { "name": "predis/predis", From 4e3077696dc394a5e4ac9eab1b45f9d413ff37f8 Mon Sep 17 00:00:00 2001 From: Damiano Improta Date: Fri, 9 Jan 2026 14:50:57 +0100 Subject: [PATCH 04/19] csfixer --- src/Service/MemcacheCache.php | 5 ++--- src/Service/RedisCache.php | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Service/MemcacheCache.php b/src/Service/MemcacheCache.php index e88bb27..e14b9b7 100644 --- a/src/Service/MemcacheCache.php +++ b/src/Service/MemcacheCache.php @@ -15,7 +15,6 @@ */ class MemcacheCache extends Cache { - /** * * {@inheritDoc} @@ -191,7 +190,7 @@ protected function assertConfig(array $configuration): void { if (!array_key_exists('instance', $configuration) || $configuration['instance'] instanceof Memcache) { parent::assertConfig($configuration); - } else if (array_key_exists('instance', $configuration)) { + } elseif (array_key_exists('instance', $configuration)) { throw new CacheMissingConfigurationException("instance must be " . Memcache::class . " class"); } } @@ -200,4 +199,4 @@ protected function assertConfig(array $configuration): void private array $mandatoryKeys = [ 'server_address' ]; -} \ No newline at end of file +} diff --git a/src/Service/RedisCache.php b/src/Service/RedisCache.php index a07b6bb..a31635c 100644 --- a/src/Service/RedisCache.php +++ b/src/Service/RedisCache.php @@ -15,7 +15,6 @@ */ class RedisCache extends Cache { - /** * * {@InheritDoc} @@ -160,7 +159,7 @@ protected function assertConfig(array $configuration): void { if (!array_key_exists('instance', $configuration) || $configuration['instance'] instanceof PredisClient) { parent::assertConfig($configuration); - } else if (array_key_exists('instance', $configuration)) { + } elseif (array_key_exists('instance', $configuration)) { throw new CacheMissingConfigurationException("instance must be " . PredisClient::class . " class"); } } @@ -168,4 +167,4 @@ protected function assertConfig(array $configuration): void private array $mandatoryKeys = [ 'server_address' ]; -} \ No newline at end of file +} From 150488c3329eef8878d462ec4d9a281a71b5be12 Mon Sep 17 00:00:00 2001 From: Damiano Improta Date: Fri, 9 Jan 2026 14:52:16 +0100 Subject: [PATCH 05/19] update format code --- .github/workflows/format-code.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/format-code.yml b/.github/workflows/format-code.yml index 4e34b1f..b53c023 100644 --- a/.github/workflows/format-code.yml +++ b/.github/workflows/format-code.yml @@ -38,8 +38,9 @@ jobs: echo "No changes to commit." else echo "Found changes, committing..." - git config --global user.name "GitHub Actions Bot" - git config --global user.email "github-actions-bot@users.noreply.github.com" + git config user.name "$GIT_AUTHOR_NAME" + git config user.email "$GIT_AUTHOR_EMAIL" + git add CHANGELOG.md git add . git commit -m "style: Fix PHP code style issues" git push From 1b29b06cfe52702ee2cb61876fd685ccd2b5f863 Mon Sep 17 00:00:00 2001 From: Damiano Improta Date: Fri, 9 Jan 2026 14:54:27 +0100 Subject: [PATCH 06/19] commit done in order to test action --- src/Service/MemcacheCache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Service/MemcacheCache.php b/src/Service/MemcacheCache.php index e14b9b7..d4efe60 100644 --- a/src/Service/MemcacheCache.php +++ b/src/Service/MemcacheCache.php @@ -190,7 +190,7 @@ protected function assertConfig(array $configuration): void { if (!array_key_exists('instance', $configuration) || $configuration['instance'] instanceof Memcache) { parent::assertConfig($configuration); - } elseif (array_key_exists('instance', $configuration)) { + } else if (array_key_exists('instance', $configuration)) { throw new CacheMissingConfigurationException("instance must be " . Memcache::class . " class"); } } From 79ae16903a91faf64c23ef2fd6ebd0cde3876202 Mon Sep 17 00:00:00 2001 From: Damiano Improta Date: Fri, 9 Jan 2026 14:59:46 +0100 Subject: [PATCH 07/19] fix workflow --- .github/workflows/format-code.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/format-code.yml b/.github/workflows/format-code.yml index b53c023..812f760 100644 --- a/.github/workflows/format-code.yml +++ b/.github/workflows/format-code.yml @@ -32,16 +32,18 @@ jobs: - name: format code run: bash commands php-cs-fixer - - name: Commit and Push changes + - name: Commit and push changelog to PR branch + env: + GIT_AUTHOR_NAME: github-actions + GIT_AUTHOR_EMAIL: actions@github.com run: | - if [ -z "$(git status --porcelain)" ]; then + git config user.name "$GIT_AUTHOR_NAME" + git config user.email "$GIT_AUTHOR_EMAIL" + git add CHANGELOG.md + if git diff --staged --quiet; then echo "No changes to commit." - else - echo "Found changes, committing..." - git config user.name "$GIT_AUTHOR_NAME" - git config user.email "$GIT_AUTHOR_EMAIL" - git add CHANGELOG.md - git add . - git commit -m "style: Fix PHP code style issues" - git push - fi \ No newline at end of file + exit 0 + fi + commit_msg="style: Fix PHP code style issues" + git commit -m "$commit_msg" + git push origin HEAD:${{ github.event.pull_request.head.ref }} \ No newline at end of file From 97276dd4279aede09d3288f7d61182e154c108ef Mon Sep 17 00:00:00 2001 From: Damiano Improta Date: Fri, 9 Jan 2026 15:08:48 +0100 Subject: [PATCH 08/19] fix workflow --- .github/workflows/format-code.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/format-code.yml b/.github/workflows/format-code.yml index 812f760..4410567 100644 --- a/.github/workflows/format-code.yml +++ b/.github/workflows/format-code.yml @@ -46,4 +46,16 @@ jobs: fi commit_msg="style: Fix PHP code style issues" git commit -m "$commit_msg" - git push origin HEAD:${{ github.event.pull_request.head.ref }} \ No newline at end of file + git push origin HEAD:${{ github.event.pull_request.head.ref }} + + if [ -z "$(git status --porcelain)" ]; then + echo "No changes to commit." + else + echo "Found changes, committing..." + git config user.name "$GIT_AUTHOR_NAME" + git config user.email "$GIT_AUTHOR_EMAIL" + git add . + commit_msg="style: Fix PHP code style issues" + git commit -m "$commit_msg" + git push origin HEAD:${{ github.event.pull_request.head.ref }} + fi \ No newline at end of file From 6ded642f5172e69399f7c9f89612afac9b8d9fcb Mon Sep 17 00:00:00 2001 From: Damiano Improta Date: Fri, 9 Jan 2026 15:09:11 +0100 Subject: [PATCH 09/19] fix workflow --- .github/workflows/format-code.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/format-code.yml b/.github/workflows/format-code.yml index 4410567..e6e4051 100644 --- a/.github/workflows/format-code.yml +++ b/.github/workflows/format-code.yml @@ -37,17 +37,6 @@ jobs: GIT_AUTHOR_NAME: github-actions GIT_AUTHOR_EMAIL: actions@github.com run: | - git config user.name "$GIT_AUTHOR_NAME" - git config user.email "$GIT_AUTHOR_EMAIL" - git add CHANGELOG.md - if git diff --staged --quiet; then - echo "No changes to commit." - exit 0 - fi - commit_msg="style: Fix PHP code style issues" - git commit -m "$commit_msg" - git push origin HEAD:${{ github.event.pull_request.head.ref }} - if [ -z "$(git status --porcelain)" ]; then echo "No changes to commit." else From f793d881e710ebf5c17a7ff4f00cab07fef0cbd4 Mon Sep 17 00:00:00 2001 From: Damiano Improta Date: Fri, 9 Jan 2026 15:19:07 +0100 Subject: [PATCH 10/19] fix workflow --- .github/workflows/format-code.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/format-code.yml b/.github/workflows/format-code.yml index e6e4051..b6b7a2a 100644 --- a/.github/workflows/format-code.yml +++ b/.github/workflows/format-code.yml @@ -46,5 +46,6 @@ jobs: git add . commit_msg="style: Fix PHP code style issues" git commit -m "$commit_msg" + git pull origin ${{ github.event.pull_request.head.ref }} git push origin HEAD:${{ github.event.pull_request.head.ref }} fi \ No newline at end of file From 8218d2e57216cff093c73b61c28969d9024a3019 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 9 Jan 2026 14:23:44 +0000 Subject: [PATCH 11/19] chore: update CHANGELOG for PR #33 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64be03c..7ab71cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,3 +16,5 @@ - [2026-01-05] DamImpr: add persistent connection redis [#31](https://github.com/DamImpr/cache-multi-layer/pull/31) - [2026-01-09] DamImpr: Redis and memcache cache, instance passed in construction [#32](https://github.com/DamImpr/cache-multi-layer/pull/32) + +- [2026-01-09] DamImpr: Instance configuration [#33](https://github.com/DamImpr/cache-multi-layer/pull/33) From 7e271267be8fc8ea815bd745c2d9df8fa9633818 Mon Sep 17 00:00:00 2001 From: Damiano Improta Date: Fri, 9 Jan 2026 15:25:36 +0100 Subject: [PATCH 12/19] fix workflow --- .github/workflows/format-code.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/format-code.yml b/.github/workflows/format-code.yml index b6b7a2a..3ccee0d 100644 --- a/.github/workflows/format-code.yml +++ b/.github/workflows/format-code.yml @@ -37,15 +37,15 @@ jobs: GIT_AUTHOR_NAME: github-actions GIT_AUTHOR_EMAIL: actions@github.com run: | - if [ -z "$(git status --porcelain)" ]; then + git config user.name "$GIT_AUTHOR_NAME" + git config user.email "$GIT_AUTHOR_EMAIL" + git add . + if git diff --staged --quiet; then echo "No changes to commit." - else - echo "Found changes, committing..." - git config user.name "$GIT_AUTHOR_NAME" - git config user.email "$GIT_AUTHOR_EMAIL" - git add . - commit_msg="style: Fix PHP code style issues" - git commit -m "$commit_msg" - git pull origin ${{ github.event.pull_request.head.ref }} - git push origin HEAD:${{ github.event.pull_request.head.ref }} - fi \ No newline at end of file + exit 0 + fi + commit_msg="style: Fix PHP code style issues" + git commit -m "$commit_msg" + git pull origin ${{ github.event.pull_request.head.ref }} + git push origin HEAD:${{ github.event.pull_request.head.ref }} + \ No newline at end of file From 4060fc6fad177f594629bd82ca48584150e8b5fb Mon Sep 17 00:00:00 2001 From: Damiano Improta Date: Fri, 9 Jan 2026 15:29:35 +0100 Subject: [PATCH 13/19] fix workflow --- .github/workflows/format-code.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/format-code.yml b/.github/workflows/format-code.yml index 3ccee0d..a5da77c 100644 --- a/.github/workflows/format-code.yml +++ b/.github/workflows/format-code.yml @@ -39,6 +39,7 @@ jobs: run: | git config user.name "$GIT_AUTHOR_NAME" git config user.email "$GIT_AUTHOR_EMAIL" + git config pull.rebase false git add . if git diff --staged --quiet; then echo "No changes to commit." From 7b2505a86f518e28782250ae5f5684a5f009ffce Mon Sep 17 00:00:00 2001 From: Damiano Improta Date: Fri, 9 Jan 2026 15:37:28 +0100 Subject: [PATCH 14/19] fix workflow --- .github/workflows/format-code.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/format-code.yml b/.github/workflows/format-code.yml index a5da77c..ca224cc 100644 --- a/.github/workflows/format-code.yml +++ b/.github/workflows/format-code.yml @@ -14,6 +14,9 @@ jobs: contents: write steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + fetch-depth: 0 - name: Validate composer.json and composer.lock run: composer validate From 16bf272c98e5819f052b371b401b037fa97db175 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 9 Jan 2026 14:38:52 +0000 Subject: [PATCH 15/19] style: Fix PHP code style issues --- src/Service/MemcacheCache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Service/MemcacheCache.php b/src/Service/MemcacheCache.php index d4efe60..e14b9b7 100644 --- a/src/Service/MemcacheCache.php +++ b/src/Service/MemcacheCache.php @@ -190,7 +190,7 @@ protected function assertConfig(array $configuration): void { if (!array_key_exists('instance', $configuration) || $configuration['instance'] instanceof Memcache) { parent::assertConfig($configuration); - } else if (array_key_exists('instance', $configuration)) { + } elseif (array_key_exists('instance', $configuration)) { throw new CacheMissingConfigurationException("instance must be " . Memcache::class . " class"); } } From 61f64f46dac0e615e0ac32f3ce7d6f2c83badd1b Mon Sep 17 00:00:00 2001 From: Damiano Improta Date: Fri, 9 Jan 2026 15:40:01 +0100 Subject: [PATCH 16/19] fix workflow --- .github/workflows/format-code.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/format-code.yml b/.github/workflows/format-code.yml index ca224cc..4d3dba4 100644 --- a/.github/workflows/format-code.yml +++ b/.github/workflows/format-code.yml @@ -50,6 +50,5 @@ jobs: fi commit_msg="style: Fix PHP code style issues" git commit -m "$commit_msg" - git pull origin ${{ github.event.pull_request.head.ref }} git push origin HEAD:${{ github.event.pull_request.head.ref }} \ No newline at end of file From a01f63362c1a116edc7a00f738805794a10b42df Mon Sep 17 00:00:00 2001 From: Damiano Improta Date: Fri, 9 Jan 2026 15:42:36 +0100 Subject: [PATCH 17/19] file test fixer --- src/Service/RedisCache.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Service/RedisCache.php b/src/Service/RedisCache.php index a31635c..94e4124 100644 --- a/src/Service/RedisCache.php +++ b/src/Service/RedisCache.php @@ -110,7 +110,8 @@ public function getRemainingTTL(string $key): ?int protected function __construct(int $ttl, array $configuration = []) { parent::__construct($ttl, $configuration); - if (array_key_exists('instance', $configuration)) { + if (array_key_exists('instance', $configuration)) + { $this->predisClient = $configuration['instance']; } else { $this->predisClient = new PredisClient([ From 21d23f1f186c83e681a53b9fa9674ab766b436f0 Mon Sep 17 00:00:00 2001 From: Damiano Improta Date: Fri, 9 Jan 2026 15:43:07 +0100 Subject: [PATCH 18/19] change workflow --- .github/workflows/format-code.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/format-code.yml b/.github/workflows/format-code.yml index 4d3dba4..cf9cb26 100644 --- a/.github/workflows/format-code.yml +++ b/.github/workflows/format-code.yml @@ -42,7 +42,6 @@ jobs: run: | git config user.name "$GIT_AUTHOR_NAME" git config user.email "$GIT_AUTHOR_EMAIL" - git config pull.rebase false git add . if git diff --staged --quiet; then echo "No changes to commit." From fc1767057971f30ae5daf723716c8ad0974b136f Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 9 Jan 2026 14:44:29 +0000 Subject: [PATCH 19/19] style: Fix PHP code style issues --- src/Service/RedisCache.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Service/RedisCache.php b/src/Service/RedisCache.php index 94e4124..a31635c 100644 --- a/src/Service/RedisCache.php +++ b/src/Service/RedisCache.php @@ -110,8 +110,7 @@ public function getRemainingTTL(string $key): ?int protected function __construct(int $ttl, array $configuration = []) { parent::__construct($ttl, $configuration); - if (array_key_exists('instance', $configuration)) - { + if (array_key_exists('instance', $configuration)) { $this->predisClient = $configuration['instance']; } else { $this->predisClient = new PredisClient([