Completed
Pull Request — master (#602)
by Tom
08:16
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) : self
26
    {
27
        $this->name = $name;
28
29
        return $this;
30
    }
31
32
    /**
33
     * Name of the collector
34 2
     */
35
    public function getName() : string
36 2
    {
37 2
        return $this->name;
38
    }
39
40
    public function setConfiguration(?string $configuration) : void
41
    {
42
        $this->configuration = $configuration ? (string) $configuration : null;
43
    }
44 6
45
    /**
46 6
     * Configuration service name (where to set the logger)
47
     */
48
    public function getConfiguration() : string
49
    {
50
        return $this->configuration ? $this->configuration : 'doctrine.configuration.orm_default';
51
    }
52 2
53
    public function setSqlLogger(?string $sqlLogger) : void
54 2
    {
55 2
        $this->sqlLogger = $sqlLogger ? (string) $sqlLogger : null;
56
    }
57
58
    /**
59
     * SQLLogger service name
60
     */
61
    public function getSqlLogger() : ?string
62 6
    {
63
        return $this->sqlLogger;
64 6
    }
65
}
66