Code Duplication    Length = 10-11 lines in 2 locations

src/Users/UserIdentifiers.php 2 locations

@@ 15-25 (lines=11) @@
12
     * @param string $status (Default: 'ACTIVE').
13
     * @return string[]
14
     */
15
    public function all($status='ACTIVE')
16
    {
17
        $ids = [$this->data->primary_id];
18
        foreach ($this->data->user_identifier as $identifier) {
19
            if (is_null($status) || $identifier->status == $status) {
20
                $ids[] = $identifier->value;
21
            }
22
        }
23
24
        return $ids;
25
    }
26
27
    /**
28
     * Get all active user identifiers of a given type, like 'BARCODE' or 'UNIV_ID'.
@@ 34-43 (lines=10) @@
31
     * @param string $status
32
     * @return array
33
     */
34
    public function allOfType($value, $status = 'ACTIVE')
35
    {
36
        $ids = [];
37
        foreach ($this->data->user_identifier as $identifier) {
38
            if ($identifier->id_type->value == $value && (is_null($status) || $identifier->status == $status)) {
39
                $ids[] = $identifier->value;
40
            }
41
        }
42
        return $ids;
43
    }
44
45
    /**
46
     * Get the first active user identifier of a given type, like 'BARCODE' or 'UNIV_ID'.