Subn   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 9
eloc 31
dl 0
loc 63
rs 10
c 1
b 1
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B convert() 0 55 9
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;
16
17
class Subn
18
{
19
    /**
20
     * @param \Gedcom\Record\Subn $note
21
     * @param int                 $level
22
     *
23
     * @return string
24
     */
25
    public static function convert(\Gedcom\Record\Subn &$subn)
26
    {
27
        $level = 0;
28
        $output = '';
29
        $_subn = $subn->getSubn();
30
        if (empty($_subn)) {
31
            return $output;
32
        } else {
33
            $output .= $level.' '.$_subn." SUBN \n";
34
        }
35
        // level up
36
        $level++;
37
38
        // SUBM
39
        $subm = $subn->getSubm();
40
        if (!empty($subm)) {
41
            $output .= $level.' SUBM '.$subm."\n";
42
        }
43
44
        // FAMF
45
        $famf = $subn->getFamf();
46
        if (!empty($famf)) {
47
            $output .= $level.' FAMF '.$famf."\n";
48
        }
49
50
        // TEMP
51
        $temp = $subn->getTemp();
52
        if (!empty($temp)) {
53
            $output .= $level.' TEMP '.$temp."\n";
54
        }
55
56
        // ANCE
57
        $ance = $subn->getAnce();
58
        if (!empty($ance)) {
59
            $output .= $level.' ANCE '.$ance."\n";
60
        }
61
62
        // DESC
63
        $desc = $subn->getDesc();
64
        if (!empty($desc)) {
65
            $output .= $level.' DESC '.$desc."\n";
66
        }
67
        // ORDI
68
        $ordi = $subn->getOrdi();
69
        if (!empty($ordi)) {
70
            $output .= $level.' ORDI '.$ordi."\n";
71
        }
72
73
        // RIN
74
        $rin = $subn->getRin();
75
        if (!empty($rin)) {
76
            $output .= $level.' RIN '.$rin."\n";
77
        }
78
79
        return $output;
80
    }
81
}
82