Desi::read()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 5
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace FamilyTree365\LaravelGedcom\Utils\Exporter\Indi;
4
5
use FamilyTree365\LaravelGedcom\Models\PersonDesi;
6
7
class Desi
8
{
9
    /**
10
     * String $desi
11
     * String $group
12
     * Integer $group_id.
13
     */
14
    public static function read($conn, string $desi, $group = '', $group_id = 0, $subm_ids)
15
    {
16
        // store alia
17
        if (isset($subm_ids[$desi])) {
18
            $subm_id = $subm_ids[$desi];
0 ignored issues
show
Unused Code introduced by
The assignment to $subm_id is dead and can be removed.
Loading history...
19
            $key = ['group'=>$group, 'gid'=>$group_id, 'desi'=>$desi];
20
            $data = ['group'=>$group, 'gid'=>$group_id, 'desi'=>$desi];
21
            $record = PersonDesi::on($conn)->updateOrCreate($key, $data);
0 ignored issues
show
Unused Code introduced by
The assignment to $record is dead and can be removed.
Loading history...
22
        }
23
    }
24
}
25