Issues (384)

src/Writer/Fam/Slgs.php (11 issues)

Labels
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\Fam;
16
17
class Slgs
18
{
19
    /**
20
     * @param int $level
21
     *
22
     * @return string
23
     */
24
    public static function convert(\Gedcom\Record\Fam\Slgs &$slgs, $level)
25
    {
26
        $output = '';
27
        $output .= $level." SLGS \n";
28
29
        // Level up
30
        $level++;
31
32
        // $STAT;
33
        $stat = $slgs->getStat();
0 ignored issues
show
The method getStat() does not exist on Gedcom\Record\Fam\Slgs. 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

33
        /** @scrutinizer ignore-call */ 
34
        $stat = $slgs->getStat();
Loading history...
34
        if (!empty($stat)) {
35
            $output .= $level.' STAT '.$stat."\n";
0 ignored issues
show
Are you sure $stat of type Gedcom\Record\Fam\Slgs|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

35
            $output .= $level.' STAT './** @scrutinizer ignore-type */ $stat."\n";
Loading history...
36
        }
37
38
        // $date;
39
        $date = $slgs->getDate();
0 ignored issues
show
The method getDate() does not exist on Gedcom\Record\Fam\Slgs. 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

39
        /** @scrutinizer ignore-call */ 
40
        $date = $slgs->getDate();
Loading history...
40
        if (!empty($date)) {
41
            $output .= $level.' DATE '.$date."\n";
0 ignored issues
show
Are you sure $date of type Gedcom\Record\Fam\Slgs|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

41
            $output .= $level.' DATE './** @scrutinizer ignore-type */ $date."\n";
Loading history...
42
        }
43
44
        // PLAC
45
        $plac = $slgs->getPlac();
0 ignored issues
show
The method getPlac() does not exist on Gedcom\Record\Fam\Slgs. 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

45
        /** @scrutinizer ignore-call */ 
46
        $plac = $slgs->getPlac();
Loading history...
46
        if (!empty($plac)) {
47
            $output .= $level.' PLAC '.$plac."\n";
0 ignored issues
show
Are you sure $plac of type Gedcom\Record\Fam\Slgs|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

47
            $output .= $level.' PLAC './** @scrutinizer ignore-type */ $plac."\n";
Loading history...
48
        }
49
50
        // $TEMP;
51
        $temp = $slgs->getTemp();
0 ignored issues
show
The method getTemp() does not exist on Gedcom\Record\Fam\Slgs. 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

51
        /** @scrutinizer ignore-call */ 
52
        $temp = $slgs->getTemp();
Loading history...
52
        if (!empty($temp)) {
53
            $output .= $level.' TEMP '.$temp."\n";
0 ignored issues
show
Are you sure $temp of type Gedcom\Record\Fam\Slgs|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

53
            $output .= $level.' TEMP './** @scrutinizer ignore-type */ $temp."\n";
Loading history...
54
        }
55
56
        // $sour = array();
57
        $sour = $slgs->getSour();
0 ignored issues
show
The method getSour() does not exist on Gedcom\Record\Fam\Slgs. 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

57
        /** @scrutinizer ignore-call */ 
58
        $sour = $slgs->getSour();
Loading history...
58
        if (!empty($sour) && count($sour) > 0) {
0 ignored issues
show
It seems like $sour can also be of type Gedcom\Record\Fam\Slgs; however, parameter $value of count() does only seem to accept Countable|array, maybe add an additional type check? ( Ignorable by Annotation )

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

58
        if (!empty($sour) && count(/** @scrutinizer ignore-type */ $sour) > 0) {
Loading history...
59
            foreach ($sour as $item) {
60
                $_convert = \Gedcom\Writer\SourRef::convert($item, $level);
61
                $output .= $_convert;
62
            }
63
        }
64
        // $note = array();
65
        $note = $slgs->getNote();
0 ignored issues
show
The method getNote() does not exist on Gedcom\Record\Fam\Slgs. 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

65
        /** @scrutinizer ignore-call */ 
66
        $note = $slgs->getNote();
Loading history...
66
        if (!empty($note) && count($note) > 0) {
67
            foreach ($note as $item) {
68
                $_convert = \Gedcom\Writer\NoteRef::convert($item, $level);
69
                $output .= $_convert;
70
            }
71
        }
72
73
        return $output;
74
    }
75
}
76