Completed
Push — master ( cdcfa5...5f41e8 )
by Tim
02:42
created

Plugin::getClassName()   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\Plugin
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 TechDivision\Import\ConfigurationInterface;
26
use TechDivision\Import\Configuration\PluginConfigurationInterface;
27
28
/**
29
 * A simple plugin configuration implementation.
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 Plugin implements PluginConfigurationInterface
38
{
39
40
    /**
41
     * The main configuration.
42
     *
43
     * @var string
44
     */
45
    protected $configuration;
46
47
    /**
48
     * The subject's class name.
49
     *
50
     * @var string
51
     * @Type("string")
52
     * @SerializedName("class-name")
53
     */
54
    protected $className;
55
56
    /**
57
     * ArrayCollection with the information of the configured subjects.
58
     *
59
     * @var \Doctrine\Common\Collections\ArrayCollection
60
     * @Type("ArrayCollection<TechDivision\Import\Cli\Configuration\Subject>")
61
     */
62
    protected $subjects;
63
64
    /**
65
     * Set's the reference to the configuration instance.
66
     *
67
     * @param \TechDivision\Import\ConfigurationInterface $configuration The configuration instance
68
     *
69
     * @return void
70
     */
71
    public function setConfiguration(ConfigurationInterface $configuration)
72
    {
73
        $this->configuration = $configuration;
0 ignored issues
show
Documentation Bug introduced by
It seems like $configuration of type object<TechDivision\Impo...ConfigurationInterface> is incompatible with the declared type string of property $configuration.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
74
    }
75
76
    /**
77
     * Return's the reference to the configuration instance.
78
     *
79
     * @return \TechDivision\Import\ConfigurationInterface The configuration instance
80
     */
81
    public function getConfiguration()
82
    {
83
        return $this->configuration;
84
    }
85
86
    /**
87
     * Return's the subject's class name.
88
     *
89
     * @return string The subject's class name
90
     */
91
    public function getClassName()
92
    {
93
        return $this->className;
94
    }
95
96
    /**
97
     * Return's the ArrayCollection with the operation's subjects.
98
     *
99
     * @return \Doctrine\Common\Collections\ArrayCollection The ArrayCollection with the operation's subjects
100
     */
101
    public function getSubjects()
102
    {
103
        return $this->subjects;
104
    }
105
}
106