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

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