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...
26
{
27
/**
28
* fromPg
29
*
30
* @see ConverterInterface
31
*/
32
public function fromPg($data, $type, Session $session)
33
{
34
$data = trim($data);
35
36
if ($data === '') {
37
return null;
38
}
39
40
return (int)$data;
41
}
42
43
/**
44
* toPg
45
*
46
* @see ConverterInterface
47
*/
48
public function toPg($data, $type, Session $session)
49
{
50
return
51
$data !== null
52
? sprintf("%s '%u'", $type, $data)
53
: sprintf("NULL::%s", $type)
54
;
55
}
56
57
/**
58
* toPgStandardFormat
59
*
60
* @see ConverterInterface
61
*/
62
public function toPgStandardFormat($data, $type, Session $session)
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.