Completed
Push — master ( 876aec...44d674 )
by John
03:09
created

ManagerRegistryCachingEndpointFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
getManagerRegistryCachingEndpoint() 0 1 ?
A __construct() 0 5 1
A getCachingEndpoint() 0 6 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
    public function __construct(ManagerRegistry $managerRegistry, CacheItemPoolInterface $cachePool, LoggerInterface $logger)
18
    {
19
        $this->managerRegistry = $managerRegistry;
20
        parent::__construct($cachePool,$logger);
21
    }
22
23
    protected function getCachingEndpoint(string $name, string $version): CachingEndpoint
24
    {
25
        $endpoint = $this->getManagerRegistryCachingEndpoint($name, $version);
26
        $endpoint->setManagerRegistry($this->managerRegistry);
27
        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