Even::convert()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 21
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 11
nc 4
nop 2
dl 0
loc 21
rs 9.9
c 0
b 0
f 0
1
<?php
2
/**
3
 * php-gedcom.
4
 *
5
 * php-gedcom is a library for parsing, manipulating, importing and exporting
6
 * GEDCOM 5.5 files in PHP 5.3+.
7
 *
8
 * @author          Xiang Ming <[email protected]>
9
 * @copyright       Copyright (c) 2010-2013, Xiang Ming
10
 * @license         MIT
11
 *
12
 * @link            http://github.com/mrkrstphr/php-gedcom
13
 */
14
15
namespace PhpGedcom\Writer\SourRef;
16
17
class Even
18
{
19
    /**
20
     * @param \PhpGedcom\Record\SourRef\Even $even
21
     * @param int                            $level
22
     *
23
     * @return string
24
     */
25
    public static function convert(\PhpGedcom\Record\SourRef\Even &$even, $level = 0)
26
    {
27
        $output = '';
28
29
        // $_date;
30
        $_even = $even->getEven();
0 ignored issues
show
Bug introduced by
The method getEven() does not exist on PhpGedcom\Record\SourRef\Even. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

30
        /** @scrutinizer ignore-call */ 
31
        $_even = $even->getEven();
Loading history...
31
        if (!empty($_even)) {
32
            $output .= $level.' EVEN '.$_even."\n";
0 ignored issues
show
Bug introduced by
Are you sure $_even of type PhpGedcom\Record\SourRef\Even|mixed can be used in concatenation? ( Ignorable by Annotation )

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

32
            $output .= $level.' EVEN './** @scrutinizer ignore-type */ $_even."\n";
Loading history...
33
        } else {
34
            $output = $level." EVEN\n";
35
        }
36
        // level up
37
        $level++;
38
39
        // $_role ROLE
40
        $_role = $data->getRole();
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $data seems to be never defined.
Loading history...
41
        if (!empty($_role)) {
42
            $output .= $level.' ROLE '.$_role."\n";
43
        }
44
45
        return $output;
46
    }
47
}
48