Code Duplication    Length = 21-27 lines in 2 locations

src/WebHemi/Middleware/Action/Website/IndexAction.php 2 locations

@@ 223-249 (lines=27) @@
220
     * @param  int $userId
221
     * @return array
222
     */
223
    protected function getPublicationAuthor(int $applicationId, int $userId) : array
224
    {
225
        /**
226
         * @var Entity\UserEntity $user
227
         */
228
        $user = $this->getUserStorage()
229
            ->getUserById($userId);
230
231
        /**
232
         * @var array $userMeta
233
         */
234
        $userMeta = $this->getUserStorage()
235
            ->getSimpleUserMetaListByUser($userId);
236
237
        /**
238
         * @var Entity\FilesystemDirectoryDataEntity $userDirectoryData
239
         */
240
        $userDirectoryData = $this->getFilesystemStorage()
241
            ->getFilesystemDirectoryDataByApplicationAndProxy($applicationId, ProxyInterface::LIST_USER);
242
243
        return [
244
            'userId' => $userId,
245
            'userName' => $user->getUserName(),
246
            'url' => $userDirectoryData->getUri().'/'.$user->getUserName(),
247
            'meta' => $userMeta,
248
        ];
249
    }
250
251
    /**
252
     * Collects all the tags for a filesystem record.
@@ 294-314 (lines=21) @@
291
     * @param  int $categoryId
292
     * @return array
293
     */
294
    protected function getPublicationCategory(int $applicationId, int $categoryId) : array
295
    {
296
        /**
297
         * @var Entity\FilesystemCategoryEntity $categoryEntity
298
         */
299
        $categoryEntity = $this->getFilesystemStorage()
300
            ->getFilesystemCategoryById($categoryId);
301
302
        /**
303
         * @var Entity\FilesystemDirectoryDataEntity $categoryDirectoryData
304
         */
305
        $categoryDirectoryData = $this->getFilesystemStorage()
306
            ->getFilesystemDirectoryDataByApplicationAndProxy($applicationId, ProxyInterface::LIST_CATEGORY);
307
308
        $category = [
309
            'url' => $categoryDirectoryData->getUri().'/'.$categoryEntity->getName(),
310
            'name' => $categoryEntity->getName(),
311
            'title' => $categoryEntity->getTitle()
312
        ];
313
        return $category;
314
    }
315
}
316