Completed
Pull Request — master (#62)
by Tim
28:18
created

Logger::getHandlers()   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 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
/**
4
 * TechDivision\Import\Cli\Configuration\Logger
5
 *
6
 * NOTICE OF LICENSE
7
 *
8
 * This source file is subject to the Open Software License (OSL 3.0)
9
 * that is available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * PHP version 5
13
 *
14
 * @author    Tim Wagner <[email protected]>
15
 * @copyright 2016 TechDivision GmbH <[email protected]>
16
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
 * @link      https://github.com/techdivision/import-cli-simple
18
 * @link      http://www.techdivision.com
19
 */
20
21
namespace TechDivision\Import\Cli\Configuration;
22
23
use JMS\Serializer\Annotation\Type;
24
use JMS\Serializer\Annotation\SerializedName;
25
use Doctrine\Common\Collections\ArrayCollection;
26
use TechDivision\Import\Configuration\LoggerConfigurationInterface;
27
28
/**
29
 * The logger configuration.
30
 *
31
 * @author    Tim Wagner <[email protected]>
32
 * @copyright 2016 TechDivision GmbH <[email protected]>
33
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
 * @link      https://github.com/techdivision/import-cli-simple
35
 * @link      http://www.techdivision.com
36
 */
37
class Logger implements LoggerConfigurationInterface
38
{
39
40
    /**
41
     * The trait that provides parameter handling functionality.
42
     *
43
     * @var \TechDivision\Import\Cli\Configuration\ParamsTrait
44
     */
45
    use ParamsTrait;
46
47
    /**
48
     * The logger's channel name to use.
49
     *
50
     * @var string
51
     * @Type("string")
52
     * @SerializedName("channel-name")
53
     */
54
    protected $channelName;
55
56
    /**
57
     * The logger's unique name to use.
58
     *
59
     * @var string
60
     * @Type("string")
61
     */
62
    protected $name;
63
64
    /**
65
     * The logger's type to use.
66
     *
67
     * @var string
68
     * @Type("string")
69
     */
70
    protected $type;
71
72
    /**
73
     * ArrayCollection with the information of the configured processors.
74
     *
75
     * @var \Doctrine\Common\Collections\ArrayCollection
76
     * @Type("ArrayCollection<TechDivision\Import\Cli\Configuration\Logger\Processor>")
77
     */
78
    protected $processors = array();
79
80
    /**
81
     * ArrayCollection with the information of the configured handlers.
82
     *
83
     * @var \Doctrine\Common\Collections\ArrayCollection
84
     * @Type("ArrayCollection<TechDivision\Import\Cli\Configuration\Logger\Handler>")
85
     */
86
    protected $handlers = array();
87
88
    /**
89
     * Initialize the logger instance.
90
     */
91
    public function __construct()
92
    {
93
        $this->processors = new ArrayCollection();
94
        $this->handlers = new ArrayCollection();
95
    }
96
97
    /**
98
     * Return's the logger's channel name to use.
99
     *
100
     * @return string The channel name
101
     */
102
    public function getChannelName()
103
    {
104
        return $this->channelName;
105
    }
106
107
    /**
108
     * Return's the logger's unique name to use.
109
     *
110
     * @return string The unique name
111
     */
112
    public function getName()
113
    {
114
        return $this->name;
115
    }
116
117
    /**
118
     * Return's the logger's type to use.
119
     *
120
     * @return string The type
121
     */
122
    public function getType()
123
    {
124
        return $this->type;
125
    }
126
127
    /**
128
     * Return's the array with the logger's processors.
129
     *
130
     * @return \Doctrine\Common\Collections\ArrayCollection The ArrayCollection with the processors
131
     */
132
    public function getProcessors()
133
    {
134
        return $this->processors;
135
    }
136
137
    /**
138
     * Return's the array with the logger's handlers.
139
     *
140
     * @return \Doctrine\Common\Collections\ArrayCollection The ArrayCollection with the handlers
141
     */
142
    public function getHandlers()
143
    {
144
        return $this->handlers;
145
    }
146
}
147