Psr16CacheThrottleTest::createStore()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 2
nc 2
nop 0
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