Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 88-99 (lines=12) @@
85
     *
86
     * @return \eZ\Publish\API\Repository\Values\Content\LocationCreateStruct
87
     */
88
    public function newLocationCreateStruct($parentLocationId, ContentType $contentType = null)
89
    {
90
        $properties = [
91
            'parentLocationId' => $parentLocationId,
92
        ];
93
        if ($contentType) {
94
            $properties['sortField'] = $contentType->defaultSortField;
95
            $properties['sortOrder'] = $contentType->defaultSortOrder;
96
        }
97
98
        return new LocationCreateStruct($properties);
99
    }
100
101
    /**
102
     * Creates the new $location in the content repository for the given content.

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

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