Code Duplication    Length = 12-12 lines in 2 locations

src/Http/BaseController.php 2 locations

@@ 180-191 (lines=12) @@
177
     * @throws ContainerExceptionInterface
178
     * @throws NotFoundExceptionInterface
179
     */
180
    protected static function readRelationship(
181
        string $index,
182
        string $relationshipName,
183
        ContainerInterface $container,
184
        ServerRequestInterface $request
185
    ): ResponseInterface {
186
        $apiHandler = function (CrudInterface $crud) use ($index, $relationshipName) {
187
            return $crud->readRelationship($index, $relationshipName);
188
        };
189
190
        return static::readRelationshipWithClosure($apiHandler, $relationshipName, $container, $request);
191
    }
192
193
    /** @deprecated Use `readRelationshipIdentifiersWithClosure` instead
194
     * @param string                 $index
@@ 204-215 (lines=12) @@
201
     * @throws ContainerExceptionInterface
202
     * @throws NotFoundExceptionInterface
203
     */
204
    protected static function readRelationshipIdentifiers(
205
        string $index,
206
        string $relationshipName,
207
        ContainerInterface $container,
208
        ServerRequestInterface $request
209
    ): ResponseInterface {
210
        $apiHandler = function (CrudInterface $crud) use ($index, $relationshipName) {
211
            return $crud->readRelationship($index, $relationshipName);
212
        };
213
214
        return static::readRelationshipIdentifiersWithClosure($apiHandler, $relationshipName, $container, $request);
215
    }
216
217
    /**
218
     * @param Closure                $apiHandler