Code Duplication    Length = 17-21 lines in 2 locations

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

@@ 164-184 (lines=21) @@
161
     * @param int $applicationId
162
     * @return array
163
     */
164
    protected function getPublicationAuthor(int $userId, int $applicationId) : array
165
    {
166
        /** @var Entity\User\UserEntity $user */
167
        $user = $this->getUserStorage()
168
            ->getUserById($userId);
169
170
        /** @var array $userMeta */
171
        $userMeta = $this->getUserMetaStorage()
172
            ->getUserMetaArrayForUserId($userId);
173
174
        /** @var array $userDirectoryData */
175
        $userDirectoryData = $this->getFilesystemDirectoryStorage()
176
            ->getDirectoryDataByApplicationAndProxy($applicationId, ProxyInterface::LIST_USER);
177
178
        return [
179
            'userId' => $userId,
180
            'userName' => $user->getUserName(),
181
            'url' => $userDirectoryData['uri'].'/'.$user->getUserName(),
182
            'meta' => $userMeta,
183
        ];
184
    }
185
186
    /**
187
     * Generates the content path.
@@ 242-258 (lines=17) @@
239
     * @param int $categoryId
240
     * @return array
241
     */
242
    protected function getPublicationCategory(int $applicationId, int $categoryId) : array
243
    {
244
        /** @var Entity\Filesystem\FilesystemCategoryEntity $categoryEntity */
245
        $categoryEntity = $this->getFilesystemCategoryStorage()
246
            ->getFilesystemCategoryById($categoryId);
247
248
        /** @var array $categoryDirectoryData */
249
        $categoryDirectoryData = $this->getFilesystemDirectoryStorage()
250
            ->getDirectoryDataByApplicationAndProxy($applicationId, ProxyInterface::LIST_CATEGORY);
251
252
        $category = [
253
            'url' => $categoryDirectoryData['uri'].'/'.$categoryEntity->getName(),
254
            'name' => $categoryEntity->getName(),
255
            'title' => $categoryEntity->getTitle()
256
        ];
257
        return $category;
258
    }
259
}
260