getUser($request), $folder)) { throw new AuthorizationFailedException(); } $fileRefs = array_map( function (\FileType $file): FileRef { return $file->getFileRef(); }, $folder->getFiles() ); [$offset, $limit] = $this->getOffsetAndLimit(); return $this->getPaginatedContentResponse( array_slice($fileRefs, $offset, $limit), count($fileRefs) ); } }