Skip to content

Commit

Permalink
Update Cache Service class reference
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Sep 27, 2023
1 parent e0083e5 commit 7581ede
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/src/Bakery/ClearCacheCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
namespace UserFrosting\Sprinkle\Core\Bakery;

use DI\Attribute\Inject;
use Illuminate\Cache\Repository as Cache;
use Illuminate\Filesystem\Filesystem;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use UserFrosting\Bakery\WithSymfonyStyle;
use UserFrosting\Cache\Cache;
use UserFrosting\Config\Config;
use UserFrosting\Sprinkle\Core\Twig\CacheHelper;
use UserFrosting\UniformResourceLocator\ResourceLocatorInterface;
Expand Down
2 changes: 1 addition & 1 deletion app/src/ServicesProvider/AlertStreamService.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

namespace UserFrosting\Sprinkle\Core\ServicesProvider;

use Illuminate\Cache\Repository as Cache;
use Psr\Container\ContainerInterface;
use UserFrosting\Alert\AlertStream;
use UserFrosting\Alert\CacheAlertStream;
use UserFrosting\Alert\SessionAlertStream;
use UserFrosting\Cache\Cache;
use UserFrosting\Config\Config;
use UserFrosting\I18n\Translator;
use UserFrosting\ServicesProvider\ServicesProviderInterface;
Expand Down
8 changes: 4 additions & 4 deletions app/src/ServicesProvider/CacheService.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
namespace UserFrosting\Sprinkle\Core\ServicesProvider;

use Exception;
use Illuminate\Cache\Repository as Cache;
use Psr\Container\ContainerInterface;
use UserFrosting\Cache\ArrayStore;
use UserFrosting\Cache\Cache;
use UserFrosting\Cache\MemcachedStore;
use UserFrosting\Cache\RedisStore;
use UserFrosting\Cache\TaggableFileStore;
Expand All @@ -39,7 +39,7 @@ public function register(): array
*
* @throws BadConfigException
*/
Cache::class => function (ContainerInterface $ci, Config $config) {
Cache::class => function (ContainerInterface $ci, Config $config) {
return match ($config->get('cache.driver')) {
'file' => $ci->get(TaggableFileStore::class)->instance(),
'memcached' => $ci->get(MemcachedStore::class)->instance(),
Expand All @@ -65,7 +65,7 @@ public function register(): array
/**
* Inject memcached config array into MemcachedStore. Also add common "prefix" key into config.
*/
MemcachedStore::class => function (Config $config) {
MemcachedStore::class => function (Config $config) {
$config = array_merge($config->get('cache.memcached'), ['prefix' => $config->get('cache.prefix')]);

return new MemcachedStore($config);
Expand All @@ -74,7 +74,7 @@ public function register(): array
/**
* Inject Redis config array into RedisStore. Also add common "prefix" key into config.
*/
RedisStore::class => function (Config $config) {
RedisStore::class => function (Config $config) {
$config = array_merge($config->get('cache.redis'), ['prefix' => $config->get('cache.prefix')]);

return new RedisStore($config);
Expand Down
2 changes: 1 addition & 1 deletion app/tests/Integration/Bakery/ClearCacheCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

namespace UserFrosting\Sprinkle\Core\Tests\Integration\Bakery;

use Illuminate\Cache\Repository as Cache;
use Illuminate\Filesystem\Filesystem;
use Mockery;
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
use UserFrosting\Cache\Cache;
use UserFrosting\Sprinkle\Core\Bakery\ClearCacheCommand;
use UserFrosting\Sprinkle\Core\Tests\CoreTestCase;
use UserFrosting\Sprinkle\Core\Twig\CacheHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
namespace UserFrosting\Sprinkle\Core\Tests\Integration\ServicesProvider;

use Illuminate\Cache\ArrayStore;
use Illuminate\Cache\Repository as Cache;
use UserFrosting\Cache\Cache;
use UserFrosting\Config\Config;
use UserFrosting\Sprinkle\Core\Tests\CoreTestCase as TestCase;

Expand Down
2 changes: 1 addition & 1 deletion app/tests/Unit/ServicesProvider/AlertStreamServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
namespace UserFrosting\Sprinkle\Core\Tests\Unit\ServicesProvider;

use DI\Container;
use Illuminate\Cache\Repository as Cache;
use Mockery;
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
use PHPUnit\Framework\TestCase;
use UserFrosting\Alert\AlertStream;
use UserFrosting\Alert\CacheAlertStream;
use UserFrosting\Alert\SessionAlertStream;
use UserFrosting\Cache\Cache;
use UserFrosting\Config\Config;
use UserFrosting\I18n\Translator;
use UserFrosting\Session\Session;
Expand Down
2 changes: 1 addition & 1 deletion app/tests/Unit/ServicesProvider/CacheServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
namespace UserFrosting\Sprinkle\Core\Tests\Unit\ServicesProvider;

use DI\Container;
use Illuminate\Cache\Repository as Cache;
use Mockery;
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
use PHPUnit\Framework\TestCase;
use UserFrosting\Cache\Cache;
use UserFrosting\Cache\MemcachedStore;
use UserFrosting\Cache\RedisStore;
use UserFrosting\Cache\TaggableFileStore;
Expand Down
8 changes: 4 additions & 4 deletions app/tests/Unit/Util/RouteListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function testGetWithNoRoutes(): void
// Set mock in CI and get class
$ci = ContainerStub::create();
$ci->set(App::class, $app);

/** @var RouteList */
$routeList = $ci->get(RouteList::class);

Expand Down Expand Up @@ -127,7 +127,7 @@ public function testGetWithSort(): void
// Set mock in CI and get class
$ci = ContainerStub::create();
$ci->set(App::class, $app);

/** @var RouteList */
$routeList = $ci->get(RouteList::class);

Expand Down Expand Up @@ -188,7 +188,7 @@ public function testGetWithBadSort(): void
// Set mock in CI and get class
$ci = ContainerStub::create();
$ci->set(App::class, $app);

/** @var RouteList */
$routeList = $ci->get(RouteList::class);

Expand Down Expand Up @@ -225,7 +225,7 @@ public function testGetWithFilter(): void
// Set mock in CI and get class
$ci = ContainerStub::create();
$ci->set(App::class, $app);

/** @var RouteList */
$routeList = $ci->get(RouteList::class);

Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
level: max
level: 8
reportUnmatchedIgnoredErrors: false
ignoreErrors:
- '#Dynamic call to static method PHPUnit\\Framework\\.*#'
Expand Down

0 comments on commit 7581ede

Please sign in to comment.