Completed
Pull Request — master (#602)
by Tom
09:02
created

SQLLoggerCollectorOptions   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 71
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 71
ccs 15
cts 15
cp 1
rs 10
c 0
b 0
f 0
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
 * @link    http://www.doctrine-project.org/
13
 */
14
class SQLLoggerCollectorOptions extends AbstractOptions
15
{
16
    /** @var string name to be assigned to the collector */
17
    protected string $name = 'orm_default';
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
18
19
    /** @var string|null service name of the configuration where the logger has to be put */
20
    protected ?string $configuration = null;
21
22
    /** @var string|null service name of the SQLLogger to be used */
23
    protected ?string $sqlLogger = null;
24
25
    public function setName(string $name) : void
26
    {
27
        $this->name = (string) $name;
28
    }
29
30
    /**
31
     * Name of the collector
32
     */
33
    public function getName() : string
34 2
    {
35
        return $this->name;
36 2
    }
37 2
38
    public function setConfiguration(?string $configuration) : void
39
    {
40
        $this->configuration = $configuration ? (string) $configuration : null;
41
    }
42
43
    /**
44 6
     * Configuration service name (where to set the logger)
45
     */
46 6
    public function getConfiguration() : string
47
    {
48
        return $this->configuration ? $this->configuration : 'doctrine.configuration.orm_default';
49
    }
50
51
    public function setSqlLogger(?string $sqlLogger) : void
52 2
    {
53
        $this->sqlLogger = $sqlLogger ? (string) $sqlLogger : null;
54 2
    }
55 2
56
    /**
57
     * SQLLogger service name
58
     */
59
    public function getSqlLogger() : ?string
60
    {
61
        return $this->sqlLogger;
62 6
    }
63
}
64