Code Duplication    Length = 8-12 lines in 3 locations

eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/DateAndTimeConverter.php 1 location

@@ 57-68 (lines=12) @@
54
     * @param \eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldValue $value
55
     * @param \eZ\Publish\SPI\Persistence\Content\FieldValue $fieldValue
56
     */
57
    public function toFieldValue(StorageFieldValue $value, FieldValue $fieldValue)
58
    {
59
        if ($value->dataInt === null) {
60
            return;
61
        }
62
63
        $fieldValue->data = array(
64
            'rfc850' => null,
65
            'timestamp' => $value->dataInt,
66
        );
67
        $fieldValue->sortKey = $value->sortKeyInt;
68
    }
69
70
    /**
71
     * Converts field definition data in $fieldDef into $storageFieldDef.

eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/UrlConverter.php 1 location

@@ 53-60 (lines=8) @@
50
     * @param \eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldValue $value
51
     * @param \eZ\Publish\SPI\Persistence\Content\FieldValue $fieldValue
52
     */
53
    public function toFieldValue(StorageFieldValue $value, FieldValue $fieldValue)
54
    {
55
        $fieldValue->data = array(
56
            'urlId' => $value->dataInt,
57
            'text' => $value->dataText,
58
        );
59
        $fieldValue->sortKey = false;
60
    }
61
62
    /**
63
     * Converts field definition data in $fieldDef into $storageFieldDef.

eZ/Publish/Core/Persistence/Legacy/Content/FieldValue/Converter/DateConverter.php 1 location

@@ 54-65 (lines=12) @@
51
     * @param \eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldValue $value
52
     * @param \eZ\Publish\SPI\Persistence\Content\FieldValue $fieldValue
53
     */
54
    public function toFieldValue(StorageFieldValue $value, FieldValue $fieldValue)
55
    {
56
        if ($value->dataInt === null || $value->dataInt == 0) {
57
            return;
58
        }
59
60
        $fieldValue->data = array(
61
            'timestamp' => $value->dataInt,
62
            'rfc850' => null,
63
        );
64
        $fieldValue->sortKey = $value->sortKeyInt;
65
    }
66
67
    /**
68
     * Converts field definition data in $fieldDef into $storageFieldDef.