Caln   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

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