This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
8
{
9
/**
10
* @var Description
11
*/
12
protected $description;
13
14
final public function __construct(string $id, Description $description)
15
{
16
parent::__construct($id);
17
$this->description = $description;
18
}
19
20
public function getDescription(): Description
21
{
22
return $this->description;
23
}
24
25
public function serialize(): array
26
{
27
return parent::serialize() + array(
28
'description' => $this->description->toNative(),
29
);
30
}
31
32
public static function deserialize(array $data): AbstractDescriptionUpdated
33
{
34
return new static($data['item_id'], new Description($data['description']));
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.