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

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