Passed
Branch master (6a7148)
by Curtis
01:48
created

Char   A

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 21 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
 * @package         php-gedcom 
11
 * @license         MIT
12
 * @link            http://github.com/mrkrstphr/php-gedcom
13
 */
14
15
namespace PhpGedcom\Writer\Head;
16
17
/**
18
 *
19
 */
20
class Char
21
{
22
    /**
23
     * @param \PhpGedcom\Record\Head\Char $char
24
     * @param string $format
25
     * @param int $level
26
     * @return string
27
     */
28
    public static function convert(\PhpGedcom\Record\Head\Char &$char, $level)
29
    {
30
        $output ="";
31
        // char
32
        $_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

32
        /** @scrutinizer ignore-call */ 
33
        $_char = $char->getChar();
Loading history...
33
        if($_char){
34
            $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

34
            $output.=$level." CHAR "./** @scrutinizer ignore-type */ $_char."\n";
Loading history...
35
        }else{
36
            return $output;
37
        }
38
39
        // level up
40
        $level++;
41
        // VERS
42
        $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

42
        /** @scrutinizer ignore-call */ 
43
        $vers = $char->getVersion();
Loading history...
43
        if($vers){
44
            $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

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