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...
13
{
14
const NAME = 'integer';
15
16
/**
17
* @inheritDoc
18
*/
19
public function getName()
20
{
21
return self::NAME;
22
}
23
24
/**
25
* @inheritDoc
26
*/
27
public function toObjectValue($value, $type, \ReflectionProperty $property, $object)
28
{
29
if ($type === 'integer' || $type === 'int') {
30
return (integer)$value;
31
}
32
33
return $value;
34
}
35
36
/**
37
* @inheritDoc
38
*/
39
public function toArrayValue($value, $type, \ReflectionProperty $property, $object)
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.