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

ManagerRegistryEndpointFactory   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 getLoggingEndpoint() 0 6 1
getManagerRegistryEndpoint() 0 1 ?
1
<?php
2
namespace LunixRESTBasics\Endpoint;
3
4
use Doctrine\Common\Persistence\ManagerRegistry;
5
use LunixREST\Endpoint\LoggingEndpoint;
6
use LunixREST\Endpoint\LoggingEndpointFactory;
7
use Psr\Log\LoggerInterface;
8
9
abstract class ManagerRegistryEndpointFactory extends LoggingEndpointFactory
10
{
11
    /**
12
     * @var ManagerRegistry
13
     */
14
    protected $managerRegistry;
15
16 1
    public function __construct(ManagerRegistry $managerRegistry, LoggerInterface $logger)
17
    {
18 1
        $this->managerRegistry = $managerRegistry;
19 1
        parent::__construct($logger);
20 1
    }
21
22 1
    protected function getLoggingEndpoint(string $name, string $version): LoggingEndpoint
23
    {
24 1
        $endpoint = $this->getManagerRegistryEndpoint($name, $version);
25 1
        $endpoint->setManagerRegistry($this->managerRegistry);
26 1
        return $endpoint;
27
    }
28
29
    protected abstract function getManagerRegistryEndpoint(string $name, string $version): ManagerRegistryEndpoint;
0 ignored issues
show
Coding Style introduced by
The abstract declaration must precede the visibility declaration
Loading history...
30
}
31