Journal   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 8
c 1
b 0
f 0
dl 0
loc 27
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A add() 0 12 4
1
<?php
2
3
namespace PubPeerFoundation\PublicationDataExtractor\Models;
4
5
class Journal extends Model
6
{
7
    /**
8
     * Hold the journal details.
9
     *
10
     * @var array
11
     */
12
    protected $list = [];
13
14
    /**
15
     * Add unknown attributes to the current details array.
16
     *
17
     * @param  array  $journal
18
     * @return array
19
     */
20
    public function add(array $journal): array
21
    {
22
        foreach ($journal as $key => $value) {
23
            if ($this->shouldKeepAttribute($key, $value)) {
24
                if (is_array($value)) {
25
                    $value = array_unique($value);
26
                }
27
                $this->list[$key] = $value;
28
            }
29
        }
30
31
        return $this->list;
32
    }
33
}
34