Even   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A convert() 0 20 3
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\Sour\Data;
16
17
class Even
18
{
19
    /**
20
     * @param \PhpGedcom\Record\Sour\Data\Even $even
21
     * @param int                              $level
22
     *
23
     * @return string
24
     */
25
    public static function convert(\PhpGedcom\Record\Sour\Data\Even &$even, $level)
26
    {
27
        $output = '';
0 ignored issues
show
Unused Code introduced by
The assignment to $output is dead and can be removed.
Loading history...
28
29
        $output = $level." EVEN\n";
30
        $level++;
31
32
        // $date;
33
        $date = $even->getDate();
0 ignored issues
show
Bug introduced by
The method getDate() does not exist on PhpGedcom\Record\Sour\Data\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

33
        /** @scrutinizer ignore-call */ 
34
        $date = $even->getDate();
Loading history...
34
        if (!empty($date)) {
35
            $output .= $level.' DATE '.$date."\n";
0 ignored issues
show
Bug introduced by
Are you sure $date of type PhpGedcom\Record\Sour\Data\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

35
            $output .= $level.' DATE './** @scrutinizer ignore-type */ $date."\n";
Loading history...
36
        }
37
38
        // Plac
39
        $plac = $even->getPlac();
0 ignored issues
show
Bug introduced by
The method getPlac() does not exist on PhpGedcom\Record\Sour\Data\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

39
        /** @scrutinizer ignore-call */ 
40
        $plac = $even->getPlac();
Loading history...
40
        if (!empty($plac)) {
41
            $output .= $level.' PLAC '.$plac."\n";
0 ignored issues
show
Bug introduced by
Are you sure $plac of type PhpGedcom\Record\Sour\Data\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

41
            $output .= $level.' PLAC './** @scrutinizer ignore-type */ $plac."\n";
Loading history...
42
        }
43
44
        return $output;
45
    }
46
}
47