SQLLoggerCollectorOptions   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 9
lcom 1
cbo 1
dl 0
loc 50
ccs 15
cts 15
cp 1
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setName() 0 4 1
A getName() 0 4 1
A setConfiguration() 0 4 2
A getConfiguration() 0 4 2
A setSqlLogger() 0 4 2
A getSqlLogger() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DoctrineORMModule\Options;
6
7
use Laminas\Stdlib\AbstractOptions;
8
9
/**
10
 * Configuration options for an collector
11
 */
12
class SQLLoggerCollectorOptions extends AbstractOptions
13
{
14
    /** @var string name to be assigned to the collector */
15
    protected $name = 'orm_default';
16
17
    /** @var string|null service name of the configuration where the logger has to be put */
18
    protected $configuration;
19
20
    /** @var string|null service name of the SQLLogger to be used */
21
    protected $sqlLogger;
22
23 2
    public function setName(?string $name) : void
24
    {
25 2
        $this->name = (string) $name;
26 2
    }
27
28
    /**
29
     * Name of the collector
30
     */
31 6
    public function getName() : string
32
    {
33 6
        return $this->name;
34
    }
35
36 2
    public function setConfiguration(?string $configuration) : void
37
    {
38 2
        $this->configuration = $configuration ? (string) $configuration : null;
39 2
    }
40
41
    /**
42
     * Configuration service name (where to set the logger)
43
     */
44 6
    public function getConfiguration() : string
45
    {
46 6
        return $this->configuration ? $this->configuration : 'doctrine.configuration.orm_default';
47
    }
48
49 3
    public function setSqlLogger(?string $sqlLogger) : void
50
    {
51 3
        $this->sqlLogger = $sqlLogger ? (string) $sqlLogger : null;
52 3
    }
53
54
    /**
55
     * SQLLogger service name
56
     */
57 6
    public function getSqlLogger() : ?string
58
    {
59 6
        return $this->sqlLogger;
60
    }
61
}
62