Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 87-98 (lines=12) @@
84
     *
85
     * @return \eZ\Publish\API\Repository\Values\Content\LocationCreateStruct
86
     */
87
    public function newLocationCreateStruct($parentLocationId, ContentType $contentType = null)
88
    {
89
        $properties = [
90
            'parentLocationId' => $parentLocationId,
91
        ];
92
        if ($contentType) {
93
            $properties['sortField'] = $contentType->defaultSortField;
94
            $properties['sortOrder'] = $contentType->defaultSortOrder;
95
        }
96
97
        return new LocationCreateStruct($properties);
98
    }
99
100
    /**
101
     * 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.