LabelProducts   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 65
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getLabelProduct() 0 3 1
A setMode() 0 5 1
A __construct() 0 4 1
A setLabelProduct() 0 5 1
A getMode() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of PHP CS Fixer.
5
 *
6
 * (c) Fabien Potencier <[email protected]>
7
 *     Dariusz Rumiński <[email protected]>
8
 *
9
 * This source file is subject to the MIT license that is bundled
10
 * with this source code in the file LICENSE.
11
 */
12
13
namespace Etrias\PaazlConnector\SoapTypes;
14
15
class LabelProducts
16
{
17
    /**
18
     * @var labelProduct
19
     */
20
    protected $labelProduct = null;
21
22
    /**
23
     * @var labelProductsModeType
24
     */
25
    protected $mode = null;
26
27
    /**
28
     * Constructor.
29
     *
30
     * @var labelProduct
31
     * @var labelProductsModeType $mode
32
     *
33
     * @param mixed $labelProduct
34
     * @param mixed $mode
35
     */
36
    public function __construct($labelProduct, $mode)
37
    {
38
        $this->labelProduct = $labelProduct;
0 ignored issues
show
Documentation Bug introduced by
$labelProduct is of type mixed, but the property $labelProduct was declared to be of type Etrias\PaazlConnector\SoapTypes\labelProduct. Are you sure that you always receive this specific sub-class here, or does it make sense to add an instanceof check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.

Either this assignment is in error or an instanceof check should be added for that assignment.

class Alien {}

class Dalek extends Alien {}

class Plot
{
    /** @var  Dalek */
    public $villain;
}

$alien = new Alien();
$plot = new Plot();
if ($alien instanceof Dalek) {
    $plot->villain = $alien;
}
Loading history...
39
        $this->mode = $mode;
40
    }
41
42
    /**
43
     * @return labelProduct
44
     */
45
    public function getLabelProduct()
46
    {
47
        return $this->labelProduct;
48
    }
49
50
    /**
51
     * @param labelProduct $labelProduct
52
     *
53
     * @return $this
54
     */
55
    public function setLabelProduct($labelProduct)
56
    {
57
        $this->labelProduct = $labelProduct;
58
59
        return $this;
60
    }
61
62
    /**
63
     * @return labelProductsModeType
64
     */
65
    public function getMode()
66
    {
67
        return $this->mode;
68
    }
69
70
    /**
71
     * @param labelProductsModeType $mode
72
     *
73
     * @return $this
74
     */
75
    public function setMode($mode)
76
    {
77
        $this->mode = $mode;
78
79
        return $this;
80
    }
81
}
82