Char   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 29
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\Head;
16
17
class Char
18
{
19
    /**
20
     * @param \PhpGedcom\Record\Head\Char $char
21
     * @param string                      $format
22
     * @param int                         $level
23
     *
24
     * @return string
25
     */
26
    public static function convert(\PhpGedcom\Record\Head\Char &$char, $level)
27
    {
28
        $output = '';
29
        // char
30
        $_char = $char->getChar();
0 ignored issues
show
Bug introduced by
The method getChar() does not exist on PhpGedcom\Record\Head\Char. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

30
        /** @scrutinizer ignore-call */ 
31
        $_char = $char->getChar();
Loading history...
31
        if ($_char) {
32
            $output .= $level.' CHAR '.$_char."\n";
0 ignored issues
show
Bug introduced by
Are you sure $_char of type PhpGedcom\Record\Head\Char|mixed can be used in concatenation? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

32
            $output .= $level.' CHAR './** @scrutinizer ignore-type */ $_char."\n";
Loading history...
33
        } else {
34
            return $output;
35
        }
36
37
        // level up
38
        $level++;
39
        // VERS
40
        $vers = $char->getVersion();
0 ignored issues
show
Bug introduced by
The method getVersion() does not exist on PhpGedcom\Record\Head\Char. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

40
        /** @scrutinizer ignore-call */ 
41
        $vers = $char->getVersion();
Loading history...
41
        if ($vers) {
42
            $output .= $level.' VERS '.$vers."\n";
0 ignored issues
show
Bug introduced by
Are you sure $vers of type PhpGedcom\Record\Head\Char|mixed can be used in concatenation? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

42
            $output .= $level.' VERS './** @scrutinizer ignore-type */ $vers."\n";
Loading history...
43
        }
44
45
        return $output;
46
    }
47
}
48