BatchStatusLabelType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 37
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getBarcode() 0 3 1
A setBarcode() 0 5 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 BatchStatusLabelType
16
{
17
    /**
18
     * @var string
19
     */
20
    protected $barcode = null;
21
22
    /**
23
     * Constructor.
24
     *
25
     * @var string
26
     *
27
     * @param mixed $barcode
28
     */
29
    public function __construct($barcode)
30
    {
31
        $this->barcode = $barcode;
0 ignored issues
show
Documentation Bug introduced by
$barcode is of type mixed, but the property $barcode was declared to be of type string. 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...
32
    }
33
34
    /**
35
     * @return string
36
     */
37
    public function getBarcode()
38
    {
39
        return $this->barcode;
40
    }
41
42
    /**
43
     * @param string $barcode
44
     *
45
     * @return $this
46
     */
47
    public function setBarcode($barcode)
48
    {
49
        $this->barcode = $barcode;
50
51
        return $this;
52
    }
53
}
54