Subm   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A read() 0 16 4
1
<?php
2
3
namespace FamilyTree365\LaravelGedcom\Utils\Exporter\Indi;
4
5
use FamilyTree365\LaravelGedcom\Models\PersonSubm;
6
7
class Subm
8
{
9
    /**
10
     * String $subm
11
     * String $group
12
     * Integer $group_id.
13
     */
14
    public static function read($conn, $item, $group = '', $group_id = 0, $subm_ids)
15
    {
16
        $record = [];
17
        foreach ($item as $subm) {
18
            if ($subm) {
19
                // store alia
20
                if (isset($subm_ids[$subm])) {
21
                    $subm_id = $subm_ids[$subm];
22
                    $key = ['group'=>$group, 'gid'=>$group_id, 'subm'=>$subm_id];
0 ignored issues
show
Unused Code introduced by
The assignment to $key is dead and can be removed.
Loading history...
23
                    $data = ['group'=>$group, 'gid'=>$group_id, 'subm'=>$subm_id];
24
                    $record[] = $data;
25
                }
26
            }
27
        }
28
29
        PersonSubm::on($conn)->insert($record);
30
    }
31
}
32