Psr16CacheThrottleTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 2
b 0
f 0
dl 0
loc 9
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createStore() 0 7 2
1
<?php
2
3
namespace Zenstruck\Governator\Tests\Integration;
4
5
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
6
use Symfony\Component\Cache\Psr16Cache;
7
use Symfony\Component\Cache\Simple\FilesystemCache;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Cache\Simple\FilesystemCache was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Zenstruck\Governator\Store;
9
use Zenstruck\Governator\Store\Psr16CacheStore;
10
11
/**
12
 * @group time-sensitive
13
 *
14
 * @author Kevin Bond <[email protected]>
15
 */
16
final class Psr16CacheThrottleTest extends BaseThrottleTest
17
{
18
    protected function createStore(): Store
19
    {
20
        if (\class_exists(Psr16Cache::class)) {
21
            return new Psr16CacheStore(new Psr16Cache(new FilesystemAdapter()));
22
        }
23
24
        return new Psr16CacheStore(new FilesystemCache());
25
    }
26
}
27