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...
16
{
17
use IsOKToolboxTrait, TSimpleIdentifierTrait;
18
/**
19
* @property string $name
20
*/
21
private $name = null;
22
23
/**
24
* Gets as name
25
*
26
* @return string
27
*/
28
public function getName()
29
{
30
return $this->name;
31
}
32
33
/**
34
* Sets a new name
35
*
36
* @param string $name
37
* @return self
38
*/
39
public function setName($name)
40
{
41
$this->name = $name;
42
return $this;
43
}
44
45
public function isOK(&$msg = null)
46
{
47
if (!$this->isTSimpleIdentifierValid($this->name)) {
48
$msg = "Name must be a valid TSimpleIdentifierValid";
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.