Even   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A convert() 0 18 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 Gedcom\Writer\Sour\Data;
16
17
class Even
18
{
19
    /**
20
     * @param int $level
21
     *
22
     * @return string
23
     */
24
    public static function convert(\Gedcom\Record\Sour\Data\Even &$even, $level)
25
    {
26
        $output = $level." EVEN\n";
27
        $level++;
28
29
        // $date;
30
        $date = $even->getDate();
0 ignored issues
show
Bug introduced by
The method getDate() does not exist on Gedcom\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

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

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

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

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