Passed
Push — master ( 1710e4...0562aa )
by nguereza
03:29 queued 01:31
created

ProductCategoryParam::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 ProductCategoryParam
12
* @package Platine\App\Param
13
* @template TEntity as Entity
14
*/
15
class ProductCategoryParam extends BaseParam
16
{
17
    /**
18
    * The name field
19
    * @var string
20
    */
21
    protected string $name;
22
23
    /**
24
    * The description field
25
    * @var string|null
26
    */
27
    protected ?string $description = null;
28
29
30
    /**
31
    * @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...
32
    * @return $this
33
    */
34
    public function fromEntity(Entity $entity): self
35
    {
36
        $this->name = $entity->name;
37
        $this->description = $entity->description;
38
39
        return $this;
40
    }
41
42
    /**
43
    * Return the name value
44
    * @return string
45
    */
46
    public function getName(): string
47
    {
48
        return $this->name;
49
    }
50
51
   /**
52
    * Return the description value
53
    * @return string|null
54
    */
55
    public function getDescription(): ?string
56
    {
57
        return $this->description;
58
    }
59
60
61
    /**
62
    * Set the name value
63
    * @param string $name
64
    * @return $this
65
    */
66
    public function setName(string $name): self
67
    {
68
        $this->name = $name;
69
70
        return $this;
71
    }
72
73
   /**
74
    * Set the description value
75
    * @param string|null $description
76
    * @return $this
77
    */
78
    public function setDescription(?string $description): self
79
    {
80
        $this->description = $description;
81
82
        return $this;
83
    }
84
}
85