1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Tebru\Gson\Internal; |
6
|
|
|
|
7
|
|
|
use Psr\SimpleCache\CacheInterface; |
8
|
|
|
use Symfony\Component\Cache\Adapter\Psr16Adapter; |
9
|
|
|
|
10
|
|
|
final class DefaultCacheProvider |
11
|
|
|
{ |
12
|
|
|
public static function createFileCache(string $cacheDir): CacheInterface |
13
|
|
|
{ |
14
|
|
|
// >= Symfony 4.3 |
15
|
|
|
if (class_exists('Symfony\Component\Cache\Psr16Cache')) { |
16
|
|
|
return new \Symfony\Component\Cache\Psr16Cache( |
17
|
|
|
new \Symfony\Component\Cache\Adapter\ChainAdapter([ |
18
|
|
|
new Psr16Adapter(self::createMemoryCache()), |
19
|
|
|
new \Symfony\Component\Cache\Adapter\PhpFilesAdapter('', 0, $cacheDir), |
20
|
|
|
]) |
21
|
|
|
); |
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
return new \Symfony\Component\Cache\Simple\ChainCache([ |
|
|
|
|
25
|
|
|
self::createMemoryCache(), |
26
|
|
|
new \Symfony\Component\Cache\Simple\PhpFilesCache('', 0, $cacheDir) |
|
|
|
|
27
|
|
|
]); |
28
|
|
|
} |
29
|
|
|
|
30
|
3 |
|
public static function createMemoryCache(): CacheInterface |
31
|
|
|
{ |
32
|
|
|
// >= Symfony 4.3 |
33
|
3 |
|
if (class_exists('Symfony\Component\Cache\Psr16Cache')) { |
34
|
3 |
|
return new \Symfony\Component\Cache\Psr16Cache( |
35
|
3 |
|
new \Symfony\Component\Cache\Adapter\ArrayAdapter(0, false) |
36
|
|
|
); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
return new \Symfony\Component\Cache\Simple\ArrayCache(0, false); |
|
|
|
|
40
|
|
|
} |
41
|
|
|
|
42
|
3 |
|
public static function createNullCache(): CacheInterface |
43
|
|
|
{ |
44
|
|
|
// >= Symfony 4.3 |
45
|
3 |
|
if (class_exists('Symfony\Component\Cache\Psr16Cache')) { |
46
|
3 |
|
return new \Symfony\Component\Cache\Psr16Cache( |
47
|
3 |
|
new \Symfony\Component\Cache\Adapter\NullAdapter() |
48
|
|
|
); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
return new \Symfony\Component\Cache\Simple\NullCache(); |
|
|
|
|
52
|
|
|
} |
53
|
|
|
} |
54
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths