Passed
Push — master ( 86cfdb...e29dd4 )
by nguereza
03:59 queued 01:47
created

PermissionParam::getDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Platine\App\Param;
6
7
use Platine\Framework\Form\Param\BaseParam;
8
use Platine\Orm\Entity;
9
10
/**
11
* @class PermissionParam
12
* @package Platine\App\Param
13
* @template TEntity as Entity
14
*/
15
class PermissionParam extends BaseParam
16
{
17
    /**
18
    * The code field
19
    * @var string
20
    */
21
    protected string $code;
22
23
    /**
24
    * The description field
25
    * @var string
26
    */
27
    protected string $description;
28
29
    /**
30
    * The depend field
31
    * @var string|null
32
    */
33
    protected ?string $depend = null;
34
35
36
    /**
37
    * @param TEntity $entity
0 ignored issues
show
Bug introduced by
The type Platine\App\Param\TEntity was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
38
    * @return $this
39
    */
40
    public function fromEntity(Entity $entity): self
41
    {
42
        $this->code = $entity->code;
43
        $this->description = $entity->description;
44
        $this->depend = $entity->depend;
45
46
        return $this;
47
    }
48
49
    /**
50
    * Return the code value
51
    * @return string
52
    */
53
    public function getCode(): string
54
    {
55
        return $this->code;
56
    }
57
58
   /**
59
    * Return the description value
60
    * @return string
61
    */
62
    public function getDescription(): string
63
    {
64
        return $this->description;
65
    }
66
67
   /**
68
    * Return the depend value
69
    * @return string|null
70
    */
71
    public function getDepend(): ?string
72
    {
73
        return $this->depend;
74
    }
75
76
77
    /**
78
    * Set the code value
79
    * @param string $code
80
    * @return $this
81
    */
82
    public function setCode(string $code): self
83
    {
84
        $this->code = $code;
85
86
        return $this;
87
    }
88
89
   /**
90
    * Set the description value
91
    * @param string $description
92
    * @return $this
93
    */
94
    public function setDescription(string $description): self
95
    {
96
        $this->description = $description;
97
98
        return $this;
99
    }
100
101
   /**
102
    * Set the depend value
103
    * @param string|null $depend
104
    * @return $this
105
    */
106
    public function setDepend(?string $depend): self
107
    {
108
        $this->depend = $depend;
109
110
        return $this;
111
    }
112
}
113