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; |
||||||
16 | |||||||
17 | class SourRef |
||||||
18 | { |
||||||
19 | /** |
||||||
20 | * @param \PhpGedcom\Record\SourRef $sour |
||||||
21 | * @param int $level |
||||||
22 | * |
||||||
23 | * @return string |
||||||
24 | */ |
||||||
25 | public static function convert(\PhpGedcom\Record\SourRef &$sour, $level) |
||||||
26 | { |
||||||
27 | $output = ''; |
||||||
28 | $_sour = $sour->getSour(); |
||||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||||
29 | if (!empty($_sour)) { |
||||||
30 | $output .= $level.' SOUR '.$_sour."\n"; |
||||||
0 ignored issues
–
show
Are you sure
$_sour of type PhpGedcom\Record\SourRef|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
![]() |
|||||||
31 | } |
||||||
32 | $level++; |
||||||
33 | // protected $_text = null; |
||||||
34 | $_text = $sour->getText(); |
||||||
0 ignored issues
–
show
The method
getText() does not exist on PhpGedcom\Record\SourRef . 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
![]() |
|||||||
35 | if (!empty($_text)) { |
||||||
36 | $output .= $level.' TEXT '.$_text."\n"; |
||||||
0 ignored issues
–
show
Are you sure
$_text of type PhpGedcom\Record\SourRef|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
![]() |
|||||||
37 | } |
||||||
38 | // protected $_note = array(); |
||||||
39 | $note = $sour->getNote(); |
||||||
0 ignored issues
–
show
The method
getNote() does not exist on PhpGedcom\Record\SourRef . 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 ($note && count($note) > 0) { |
||||||
0 ignored issues
–
show
It seems like
$note can also be of type PhpGedcom\Record\SourRef ; however, parameter $var 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
![]() |
|||||||
41 | foreach ($note as $item) { |
||||||
42 | $_convert = \PhpGedcom\Writer\NoteRef::convert($item, $level); |
||||||
43 | $output .= $_convert; |
||||||
44 | } |
||||||
45 | } |
||||||
46 | // protected $_data = null; |
||||||
47 | $_data = $sour->getData(); |
||||||
0 ignored issues
–
show
The method
getData() does not exist on PhpGedcom\Record\SourRef . 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
![]() |
|||||||
48 | if ($_data) { |
||||||
49 | $_convert = \PhpGedcom\Writer\Sour\Data::convert($_data, $level); |
||||||
0 ignored issues
–
show
It seems like
$_data can also be of type PhpGedcom\Record\SourRef ; however, parameter $data of PhpGedcom\Writer\Sour\Data::convert() does only seem to accept PhpGedcom\Record\Sour\Data , 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
![]() |
|||||||
50 | $output .= $_convert; |
||||||
51 | } |
||||||
52 | // protected $_page setPage |
||||||
53 | $_page = $sour->getPage(); |
||||||
0 ignored issues
–
show
The method
getPage() does not exist on PhpGedcom\Record\SourRef . 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
![]() |
|||||||
54 | if (!empty($_page)) { |
||||||
55 | $output .= $level.' PAGE '.$_page."\n"; |
||||||
0 ignored issues
–
show
Are you sure
$_page of type PhpGedcom\Record\SourRef|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
![]() |
|||||||
56 | } |
||||||
57 | // protected $_even = null; |
||||||
58 | $_even = $sour->getData(); |
||||||
59 | if ($_even) { |
||||||
60 | $_convert = \PhpGedcom\Writer\SourRef\Even::convert($_even, $level); |
||||||
0 ignored issues
–
show
It seems like
$_even can also be of type PhpGedcom\Record\SourRef ; however, parameter $even of PhpGedcom\Writer\SourRef\Even::convert() does only seem to accept PhpGedcom\Record\SourRef\Even , 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
![]() |
|||||||
61 | $output .= $_convert; |
||||||
62 | } |
||||||
63 | // protected $_quay |
||||||
64 | $_quay = $sour->getQuay(); |
||||||
0 ignored issues
–
show
The method
getQuay() does not exist on PhpGedcom\Record\SourRef . 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
![]() |
|||||||
65 | if (!empty($_quay)) { |
||||||
66 | $output .= $level.' QUAY '.$_quay."\n"; |
||||||
0 ignored issues
–
show
Are you sure
$_quay of type PhpGedcom\Record\SourRef|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
![]() |
|||||||
67 | } |
||||||
68 | // protected $_obje = array(); |
||||||
69 | // This is not defined in parser. |
||||||
70 | return $output; |
||||||
71 | } |
||||||
72 | } |
||||||
73 |