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; |
||||||
16 | |||||||
17 | class RepoRef |
||||||
18 | { |
||||||
19 | /** |
||||||
20 | * @param int $level |
||||||
21 | * |
||||||
22 | * @return string |
||||||
23 | */ |
||||||
24 | public static function convert(\Gedcom\Record\RepoRef &$reporef, $level) |
||||||
25 | { |
||||||
26 | $output = ''; |
||||||
27 | $_repo = $reporef->getRepo(); |
||||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||||
28 | if (empty($_sour)) { |
||||||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
|
|||||||
29 | return $output; |
||||||
30 | } else { |
||||||
31 | $output .= $level.' REPO '.$_repo."\n"; |
||||||
0 ignored issues
–
show
Are you sure
$_repo of type Gedcom\Record\RepoRef|mixed|null 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
![]() |
|||||||
32 | } |
||||||
33 | // level up |
||||||
34 | $level++; |
||||||
35 | |||||||
36 | // Note array |
||||||
37 | $note = $reporef->getNote(); |
||||||
0 ignored issues
–
show
The method
getNote() does not exist on Gedcom\Record\RepoRef . 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
![]() |
|||||||
38 | if (!empty($note) && count($note) > 0) { |
||||||
0 ignored issues
–
show
It seems like
$note can also be of type Gedcom\Record\RepoRef ; 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
![]() |
|||||||
39 | foreach ($note as $item) { |
||||||
40 | $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); |
||||||
41 | $output .= $_convert; |
||||||
42 | } |
||||||
43 | } |
||||||
44 | |||||||
45 | // _caln array |
||||||
46 | $_caln = $reporef->getCaln(); |
||||||
0 ignored issues
–
show
The method
getCaln() does not exist on Gedcom\Record\RepoRef . 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
![]() |
|||||||
47 | if (!empty($_caln) && count($_caln) > 0) { |
||||||
48 | foreach ($_caln as $item) { |
||||||
49 | $_convert = \Gedcom\Writer\Caln::convert($item, $level); |
||||||
50 | $output .= $_convert; |
||||||
51 | } |
||||||
52 | } |
||||||
53 | |||||||
54 | return $output; |
||||||
55 | } |
||||||
56 | } |
||||||
57 |