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 Kristopher Wilson <[email protected]> |
||||||
9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson |
||||||
10 | * @license MIT |
||||||
11 | * |
||||||
12 | * @link http://github.com/mrkrstphr/php-gedcom |
||||||
13 | */ |
||||||
14 | |||||||
15 | namespace Gedcom\Parser\Fam; |
||||||
16 | |||||||
17 | class Slgs extends \Gedcom\Parser\Component |
||||||
18 | { |
||||||
19 | public static function parse(\Gedcom\Parser $parser) |
||||||
20 | { |
||||||
21 | $record = $parser->getCurrentLineRecord(); |
||||||
22 | $depth = (int) $record[0]; |
||||||
23 | |||||||
24 | $slgs = new \Gedcom\Record\Fam\Slgs(); |
||||||
25 | |||||||
26 | $parser->forward(); |
||||||
27 | |||||||
28 | while (!$parser->eof()) { |
||||||
29 | $record = $parser->getCurrentLineRecord(); |
||||||
30 | $recordType = strtoupper(trim($record[1])); |
||||||
31 | $currentDepth = (int) $record[0]; |
||||||
32 | |||||||
33 | if ($currentDepth <= $depth) { |
||||||
34 | $parser->back(); |
||||||
35 | break; |
||||||
36 | } |
||||||
37 | |||||||
38 | switch ($recordType) { |
||||||
39 | case 'STAT': |
||||||
40 | $stat = \Gedcom\Parser\Fam\Slgs\Stat::parse($parser); |
||||||
41 | $slgs->setStat($stat); |
||||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||||
42 | break; |
||||||
43 | case 'DATE': |
||||||
44 | $slgs->setDate(trim($record[2])); |
||||||
0 ignored issues
–
show
The method
setDate() 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
![]() |
|||||||
45 | break; |
||||||
46 | case 'PLAC': |
||||||
47 | $slgs->setPlac(trim($record[2])); |
||||||
0 ignored issues
–
show
The method
setPlac() 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
![]() |
|||||||
48 | break; |
||||||
49 | case 'TEMP': |
||||||
50 | $slgs->setTemp(trim($record[2])); |
||||||
0 ignored issues
–
show
The method
setTemp() 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
![]() |
|||||||
51 | break; |
||||||
52 | case 'SOUR': |
||||||
53 | $sour = \Gedcom\Parser\SourRef::parse($parser); |
||||||
54 | $slgs->addSour($sour); |
||||||
55 | break; |
||||||
56 | case 'NOTE': |
||||||
57 | $note = \Gedcom\Parser\NoteRef::parse($parser); |
||||||
58 | if ($note) { |
||||||
59 | $slgs->addNote($note); |
||||||
60 | } |
||||||
61 | break; |
||||||
62 | default: |
||||||
63 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); |
||||||
64 | } |
||||||
65 | |||||||
66 | $parser->forward(); |
||||||
67 | } |
||||||
68 | |||||||
69 | return $slgs; |
||||||
70 | } |
||||||
71 | } |
||||||
72 |