Phon   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A read() 0 11 4
1
<?php
2
3
namespace FamilyTree365\LaravelGedcom\Utils\Exporter;
4
5
class Phon
6
{
7
    /**
8
     * Array of persons ID
9
     * key - old GEDCOM ID
10
     * value - new autoincrement ID.
11
     *
12
     * @var string
13
     */
14
    public static function read($conn, $phon)
0 ignored issues
show
Unused Code introduced by
The parameter $conn is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

14
    public static function read(/** @scrutinizer ignore-unused */ $conn, $phon)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
15
    {
16
        if (is_object($phon)) {
17
            if (method_exists($phon, 'getPhon')) {
18
                return $phon->getPhon();
19
            }
20
        } else {
21
            if (is_array($phon)) {
22
                return json_encode($phon);
23
            } else {
24
                return "$phon";
25
            }
26
        }
27
    }
28
}
29