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

getCachingEndpoint()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 2
crap 2
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