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

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