Code Duplication    Length = 24-24 lines in 2 locations

src/Content/FileBasedContent.php 2 locations

@@ 373-396 (lines=24) @@
370
     *
371
     * @return array with more details on the authors(s).
372
     */
373
    private function loadAuthorDetails($author)
374
    {
375
        if (is_array($author) && is_array(array_values($author)[0])) {
376
            return $author;
377
        }
378
379
        if (!is_array($author)) {
380
            $tmp = $author;
381
            $author = [];
382
            $author[] = $tmp;
383
        }
384
385
        $authors = [];
386
        foreach ($author as $acronym) {
387
            if (isset($this->author[$acronym])) {
388
                $key = $this->author[$acronym];
389
                $authors[$acronym] = $this->meta[$key];
390
            } else {
391
                $authors[$acronym]["acronym"] = $acronym;
392
            }
393
        }
394
395
        return $authors;
396
    }
397
398
399
@@ 436-459 (lines=24) @@
433
     *
434
     * @return array with more details on the category(s).
435
     */
436
    private function loadCategoryDetails($category)
437
    {
438
        if (is_array($category) && is_array(array_values($category)[0])) {
439
            return $category;
440
        }
441
442
        if (!is_array($category)) {
443
            $tmp = $category;
444
            $category = [];
445
            $category[] = $tmp;
446
        }
447
448
        $categorys = [];
449
        foreach ($category as $catKey) {
450
            if (isset($this->category[$catKey])) {
451
                $key = $this->category[$catKey];
452
                $categorys[$catKey] = $this->meta[$key];
453
            } else {
454
                $categorys[$catKey]["key"] = $catKey;
455
            }
456
        }
457
458
        return $categorys;
459
    }
460
461
462