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
Bug
introduced
by
![]() |
|||||||
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
![]() |
|||||||
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
![]() |
|||||||
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
![]() |
|||||||
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
![]() |
|||||||
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
![]() |
|||||||
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
![]() |
|||||||
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
![]() |
|||||||
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
![]() |
|||||||
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
![]() |
|||||||
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
![]() |
|||||||
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 |