Completed
Push — master ( b67af4...08e6a3 )
by John
02:45
created

getManagerRegistryCachingEndpoint()

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
ccs 0
cts 0
cp 0
c 0
b 0
f 0
nc 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