| Conditions | 4 |
| Paths | 2 |
| Total Lines | 31 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public static function parse(\PhpGedcom\Parser $parser) |
||
| 20 | { |
||
| 21 | $record = $parser->getCurrentLineRecord(); |
||
| 22 | $depth = (int) $record[0]; |
||
| 23 | |||
| 24 | $husband = new \PhpGedcom\Record\Fam\Even\Husb(); |
||
| 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 'AGE': |
||
| 40 | $husband->setAge(trim($record[2])); |
||
|
|
|||
| 41 | break; |
||
| 42 | default: |
||
| 43 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); |
||
| 44 | } |
||
| 45 | |||
| 46 | $parser->forward(); |
||
| 47 | } |
||
| 48 | |||
| 49 | return $husband; |
||
| 50 | } |
||
| 52 |