Passed
Branch master (6a7148)
by Curtis
01:48
created

Refn::convert()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 19
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 11
nc 3
nop 2
dl 0
loc 19
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
 * @package         php-gedcom 
11
 * @license         MIT
12
 * @link            http://github.com/mrkrstphr/php-gedcom
13
 */
14
15
namespace PhpGedcom\Writer;
16
17
/**
18
 *
19
 */
20
class Refn
21
{
22
    /**
23
     * @param \PhpGedcom\Record\Refn $note
24
     * @param int $level
25
     * @return string
26
     */
27
    public static function convert(\PhpGedcom\Record\Refn &$refn, $level)
28
    {
29
        
30
        $output = "";
31
        $_refn = $refn->getRefn();
32
        if(empty($_refn)){
33
            return $output;
34
        }else{
35
            $output.=$level." REFN ".$_refn."\n";
36
        }
37
        // level up
38
        $level++;
39
        // DATE
40
        $type = $refn->getType();
41
        if(!empty($type)){
42
            $output.=$level." TYPE ".$type."\n";
43
        }
44
        
45
        return $output;
46
    }
47
}
48