Caln::read()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 19
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 12
nc 2
nop 4
dl 0
loc 19
rs 9.8666
c 0
b 0
f 0
1
<?php
2
3
namespace FamilyTree365\LaravelGedcom\Utils\Importer;
4
5
class Caln
6
{
7
    /**
8
     * Gedcom\Record\Caln $caln
9
     * String $group
10
     * Integer $group_id.
11
     */
12
    public static function read($conn, $caln, $group = null, $gid = null)
13
    {
14
        if ($caln == null || is_array($caln)) {
15
            return;
16
        }
17
18
        $medi = $addr->getMedi();
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $addr seems to be never defined.
Loading history...
19
20
        $key = [
21
            'group'=> $group,
22
            'gid'  => $gid,
23
            'medi' => $medi,
24
        ];
25
        $data = [
26
            'group'=> $group,
27
            'gid'  => $gid,
28
            'medi' => $medi,
29
        ];
30
        $_caln = MCaln::on($conn)->updateOrCreate($key, $data);
0 ignored issues
show
Unused Code introduced by
The assignment to $_caln is dead and can be removed.
Loading history...
Bug introduced by
The type FamilyTree365\LaravelGedcom\Utils\Importer\MCaln was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
31
    }
32
}
33