Code Duplication    Length = 12-12 lines in 2 locations

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

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

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

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