Completed
Push — master ( f9bd82...79fc97 )
by John
05:21
created

ManagerRegistryCachingEndpointFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 22
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getCachingEndpoint() 0 6 1
getManagerRegistryCachingEndpoint() 0 1 ?
1
<?php
2
namespace LunixRESTBasics\Endpoint;
3
4
use Doctrine\Common\Persistence\ManagerRegistry;
5
use LunixREST\Endpoint\CachingEndpoint;
6
use LunixREST\Endpoint\CachingEndpointFactory;
7
use Psr\Cache\CacheItemPoolInterface;
8
use Psr\Log\LoggerInterface;
9
10
abstract class ManagerRegistryCachingEndpointFactory extends CachingEndpointFactory
11
{
12
    /**
13
     * @var ManagerRegistry
14
     */
15
    protected $managerRegistry;
16
17 1
    public function __construct(ManagerRegistry $managerRegistry, CacheItemPoolInterface $cachePool, LoggerInterface $logger)
18
    {
19 1
        $this->managerRegistry = $managerRegistry;
20 1
        parent::__construct($cachePool,$logger);
21 1
    }
22
23 1
    protected function getCachingEndpoint(string $name, string $version): CachingEndpoint
24
    {
25 1
        $endpoint = $this->getManagerRegistryCachingEndpoint($name, $version);
26 1
        $endpoint->setManagerRegistry($this->managerRegistry);
27 1
        return $endpoint;
28
    }
29
30
    protected abstract function getManagerRegistryCachingEndpoint(string $name, string $version): ManagerRegistryCachingEndpoint;
0 ignored issues
show
Coding Style introduced by
The abstract declaration must precede the visibility declaration
Loading history...
31
}
32