Code Duplication    Length = 12-12 lines in 2 locations

eZ/Publish/Core/REST/Client/LocationService.php 1 location

@@ 80-91 (lines=12) @@
77
     *
78
     * @return \eZ\Publish\API\Repository\Values\Content\LocationCreateStruct
79
     */
80
    public function newLocationCreateStruct($parentLocationId, ContentType $contentType = null)
81
    {
82
        $properties = [
83
            'parentLocationId' => $parentLocationId,
84
        ];
85
        if ($contentType) {
86
            $properties['sortField'] = $contentType->defaultSortField;
87
            $properties['sortOrder'] = $contentType->defaultSortOrder;
88
        }
89
90
        return new LocationCreateStruct($properties);
91
    }
92
93
    /**
94
     * Creates the new $location in the content repository for the given content.

eZ/Publish/Core/Repository/LocationService.php 1 location

@@ 808-819 (lines=12) @@
805
     *
806
     * @return \eZ\Publish\API\Repository\Values\Content\LocationCreateStruct
807
     */
808
    public function newLocationCreateStruct($parentLocationId, ContentType $contentType = null)
809
    {
810
        $properties = [
811
            'parentLocationId' => $parentLocationId,
812
        ];
813
        if ($contentType) {
814
            $properties['sortField'] = $contentType->defaultSortField;
815
            $properties['sortOrder'] = $contentType->defaultSortOrder;
816
        }
817
818
        return new LocationCreateStruct($properties);
819
    }
820
821
    /**
822
     * Instantiates a new location update class.