Gedc   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 28
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
 * @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