Husb::convert()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 15
c 0
b 0
f 0
rs 10
cc 2
nc 2
nop 2
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\Fam\Even;
16
17
class Husb
18
{
19
    /**
20
     * @param \Gedcom\Record\Fam\Even\Husb $attr
21
     * @param int                          $level
22
     *
23
     * @return string
24
     */
25
    public static function convert(\Gedcom\Record\Fam\Even\Husb &$husb, $level = 0)
26
    {
27
        $output = '';
28
29
        $output .= $level." WIFE \n";
30
        // level up
31
        $level++;
32
33
        // AGE
34
        $age = $husb->getAge();
0 ignored issues
show
Bug introduced by
The method getAge() does not exist on Gedcom\Record\Fam\Even\Husb. 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

34
        /** @scrutinizer ignore-call */ 
35
        $age = $husb->getAge();
Loading history...
35
        if (!empty($age)) {
36
            $output .= $level.' AGE '.$age."\n";
0 ignored issues
show
Bug introduced by
Are you sure $age of type Gedcom\Record\Fam\Even\Husb|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

36
            $output .= $level.' AGE './** @scrutinizer ignore-type */ $age."\n";
Loading history...
37
        }
38
39
        return $output;
40
    }
41
}
42