Passed
Push — master ( d1cb49...2d4b0e )
by Pieter
02:46
created

PsrCacheBridgePlugin::getCacheItemPool()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace W2w\Laravel\Apie\Plugins\PsrCacheBridge;
4
5
use Illuminate\Container\Container;
6
use Illuminate\Contracts\Cache\Repository;
7
use Madewithlove\IlluminatePsrCacheBridge\Laravel\CacheItemPool;
0 ignored issues
show
Bug introduced by
The type Madewithlove\IlluminateP...e\Laravel\CacheItemPool 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 Psr\Cache\CacheItemPoolInterface;
9
use W2w\Lib\Apie\PluginInterfaces\CacheItemPoolProviderInterface;
10
11
class PsrCacheBridgePlugin implements CacheItemPoolProviderInterface
12
{
13
    private $container;
14
15
    public function __construct(Container $container)
16
    {
17
        $this->container = $container;
18
    }
19
20
    public function getCacheItemPool(): CacheItemPoolInterface
21
    {
22
        $repository = $this->container->make(Repository::class);
23
        return new CacheItemPool($repository);
24
    }
25
}
26