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...
14
{
15
/**
16
* Metadata attributes
17
*
18
* @var array
19
*/
20
protected $metadata = [];
21
22
/**
23
* Set attribute of metadata
24
*
25
* @param string $name
26
* @param $value
27
*/
28
public function setMetadataAttribute(string $name, $value)
29
{
30
$this->metadata[$name] = $value;
31
}
32
33
/**
34
* Has attribute of metadata
35
*
36
* @param string $name
37
* @return bool
38
*/
39
public function hasMetadataAttribute(string $name): bool
40
{
41
return array_key_exists($name, $this->metadata);
42
}
43
44
/**
45
* Get attribute of metadata
46
*
47
* @param string $name
48
* @return mixed
49
*/
50
public function getMetadataAttribute(string $name)
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.