Completed
Push — master ( 1cbc0d...3b863a )
by Joachim
11:52
created

ProductTrait::isValidBarCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Loevgaard\DandomainConsignment\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
trait ProductTrait
8
{
9
    /**
10
     * @var boolean
11
     *
12
     * @ORM\Column(type="boolean")
13
     */
14
    protected $validBarCode = false;
15
16
    /**
17
     * @return bool
18
     */
19
    public function isValidBarCode(): bool
20
    {
21
        return $this->validBarCode;
22
    }
23
24
    /**
25
     * @param bool $validBarCode
26
     * @return ProductTrait
0 ignored issues
show
Comprehensibility Bug introduced by
The return type ProductTrait is a trait, and thus cannot be used for type-hinting in PHP. Maybe consider adding an interface and use that for type-hinting?

In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.

If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.

Loading history...
27
     */
28
    public function setValidBarCode(bool $validBarCode)
29
    {
30
        $this->validBarCode = $validBarCode;
31
        return $this;
32
    }
33
}