From b664821708c4b7b8d7d2db442c733623506c91cf Mon Sep 17 00:00:00 2001 From: Indrek Haav Date: Fri, 30 May 2025 10:34:29 +0300 Subject: [PATCH] Fix misspelling of APCu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 925a5d491f97f486c5e2cfb905f8db13edd3b3a1) Signed-off-by: MaurĂ­cio Meneghini Fauth --- README.md | 4 ++-- composer.json | 6 +++--- src/Cache/ApcuCache.php | 2 +- tests/Cache/ApcuCacheFactoryTest.php | 2 +- tests/Cache/ApcuCacheTest.php | 2 +- tests/Cache/ApcuDisabledTest.php | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1aea481..61ecae8 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ If you are using `Loader`, pass it an `ApcuCacheFactory` _before_ getting the tr ```php PhpMyAdmin\MoTranslator\Loader::setCacheFactory( - new PhpMyAdmin\MoTranslator\Cache\AcpuCacheFactory() + new PhpMyAdmin\MoTranslator\Cache\ApcuCacheFactory() ); $loader = new PhpMyAdmin\MoTranslator\Loader(); @@ -160,7 +160,7 @@ to the `ApcuCacheFactory` or when instantiating `ApcuCache`: ```php PhpMyAdmin\MoTranslator\Loader::setCacheFactory( - new PhpMyAdmin\MoTranslator\Cache\AcpuCacheFactory( + new PhpMyAdmin\MoTranslator\Cache\ApcuCacheFactory( 3600, // cache for 1 hour true, // reload on cache miss 'custom_' // custom prefix for cache entries diff --git a/composer.json b/composer.json index fd2ddeb..444adb5 100644 --- a/composer.json +++ b/composer.json @@ -39,6 +39,9 @@ "phpstan/phpstan-strict-rules": "^1.6", "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12.5 || ^13.3" }, + "suggest": { + "ext-apcu": "Needed for APCu-backed translation cache" + }, "autoload": { "psr-4": { "PhpMyAdmin\\MoTranslator\\": "src" @@ -55,8 +58,5 @@ "dealerdirect/phpcodesniffer-composer-installer": true, "phpstan/extension-installer": true } - }, - "suggest": { - "ext-apcu": "Needed for ACPu-backed translation cache" } } diff --git a/src/Cache/ApcuCache.php b/src/Cache/ApcuCache.php index 43b957e..cdb0787 100644 --- a/src/Cache/ApcuCache.php +++ b/src/Cache/ApcuCache.php @@ -46,7 +46,7 @@ public function __construct( string $prefix = 'mo_' ) { if (! (function_exists('apcu_enabled') && apcu_enabled())) { - throw new CacheException('ACPu extension must be installed and enabled'); + throw new CacheException('APCu extension must be installed and enabled'); } $this->parser = $parser; diff --git a/tests/Cache/ApcuCacheFactoryTest.php b/tests/Cache/ApcuCacheFactoryTest.php index d626ecf..714eabf 100644 --- a/tests/Cache/ApcuCacheFactoryTest.php +++ b/tests/Cache/ApcuCacheFactoryTest.php @@ -31,7 +31,7 @@ protected function setUp(): void return; } - $this->markTestSkipped('ACPu extension is not installed and enabled for CLI'); + $this->markTestSkipped('APCu extension is not installed and enabled for CLI'); } protected function tearDown(): void diff --git a/tests/Cache/ApcuCacheTest.php b/tests/Cache/ApcuCacheTest.php index d44ed89..c6083e5 100644 --- a/tests/Cache/ApcuCacheTest.php +++ b/tests/Cache/ApcuCacheTest.php @@ -37,7 +37,7 @@ protected function setUp(): void return; } - $this->markTestSkipped('ACPu extension is not installed and enabled for CLI'); + $this->markTestSkipped('APCu extension is not installed and enabled for CLI'); } protected function tearDown(): void diff --git a/tests/Cache/ApcuDisabledTest.php b/tests/Cache/ApcuDisabledTest.php index 60b4a49..7756821 100644 --- a/tests/Cache/ApcuDisabledTest.php +++ b/tests/Cache/ApcuDisabledTest.php @@ -21,7 +21,7 @@ public function testConstructorApcuNotEnabledThrowsException(): void } $this->expectException(CacheException::class); - $this->expectExceptionMessage('ACPu extension must be installed and enabled'); + $this->expectExceptionMessage('APCu extension must be installed and enabled'); new ApcuCache(new MoParser(null), 'foo', 'bar'); } }