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

Caln   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A convert() 0 19 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
 * @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 Caln
21
{
22
    /**
23
     * @param \PhpGedcom\Record\Caln $note
24
     * @param int $level
25
     * @return string
26
     */
27
    public static function convert(\PhpGedcom\Record\Caln &$caln, $level)
28
    {
29
        $output = "";
30
        $_caln = $caln->getCaln();
31
        if(empty($_caln)){
32
            return $output;
33
        }else{
34
            $output.=$level." CALN ".$_caln."\n";
35
        }
36
37
        // level up
38
        $level++;
39
40
        // medi
41
        $medi = $caln->getMedi();
42
        if(!empty($medi)){
43
            $output.=$level." MEDI ".$medi."\n";
44
        }
45
        return $output;
46
    }
47
}
48