Gedc::convert()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 19
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 9
nc 4
nop 2
dl 0
loc 19
rs 9.9666
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
 * @license         MIT
11
 *
12
 * @link            http://github.com/mrkrstphr/php-gedcom
13
 */
14
15
namespace PhpGedcom\Writer\Head;
16
17
class Gedc
18
{
19
    /**
20
     * @param \PhpGedcom\Record\Head\Gedc $gedc
21
     * @param string                      $format
22
     * @param int                         $level
23
     *
24
     * @return string
25
     */
26
    public static function convert(\PhpGedcom\Record\Head\Gedc &$gedc, $level)
27
    {
28
        $output = $level." GEDC \n";
29
30
        // level up
31
        $level++;
32
        // VERS
33
        $vers = $gedc->getVersion();
34
        if ($vers) {
35
            $output .= $level.' VERS '.$vers."\n";
36
        }
37
38
        // FORM
39
        $form = $gedc->getForm();
40
        if ($form) {
41
            $output .= $level.' FORM '.$form."\n";
42
        }
43
44
        return $output;
45
    }
46
}
47