Phon::read()   A
last analyzed

Complexity

Conditions 4
Paths 4

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 8
nc 4
nop 2
dl 0
loc 11
rs 10
c 0
b 0
f 0
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