Completed
Push — master ( 068584...6f6103 )
by John
04:49
created

CachingLoggingEndpointFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
crap 2
1
<?php
2
namespace LunixREST\Endpoint;
3
4
use Psr\Cache\CacheItemPoolInterface;
5
use Psr\Log\LoggerInterface;
6
7
/**
8
 * Class CachingLoggingEndpointFactory
9
 * @package LunixREST\Endpoint
10
 */
11
abstract class CachingLoggingEndpointFactory implements EndpointFactory
12
{
13
    /**
14
     * @var CacheItemPoolInterface
15
     */
16
    protected $cachePool;
17
    /**
18
     * @var LoggerInterface
19
     */
20
    protected $logger;
21
22
    /**
23
     * CachingEndpointFactory constructor.
24
     * @param CacheItemPoolInterface $cachePool
25
     * @param LoggerInterface $logger
26
     */
27
    public function __construct(CacheItemPoolInterface $cachePool, LoggerInterface $logger)
0 ignored issues
show
Unused Code introduced by
The parameter $logger is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
28
    {
29
        $this->cachePool = $cachePool;
30
    }
31
32
    /**
33
     * @param string $name
34
     * @param string $version
35
     * @return Endpoint
36
     */
37
    public function getEndpoint(string $name, string $version): Endpoint
38
    {
39
        $endpoint = $this->getCachingLoggingEndpoint($name, $version);
40
        $endpoint->setCachePool($this->cachePool);
41
        $endpoint->setLogger($this->logger);
42
        return $endpoint;
43
    }
44
45
    /**
46
     * @param string $name
47
     * @param string $version
48
     * @return CachingLoggingEndpoint
49
     */
50
    public abstract function getCachingLoggingEndpoint(string $name, string $version): CachingLoggingEndpoint;
0 ignored issues
show
Coding Style introduced by
The abstract declaration must precede the visibility declaration
Loading history...
51
}
52