| Conditions | 4 |
| Paths | 3 |
| Total Lines | 35 |
| Code Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public static function parse(\PhpGedcom\Parser $parser) |
||
| 29 | { |
||
| 30 | $record = $parser->getCurrentLineRecord(); |
||
| 31 | $depth = (int)$record[0]; |
||
| 32 | if(isset($record[2])){ |
||
| 33 | $phone = new \PhpGedcom\Record\Phon(); |
||
| 34 | $phone->setPhon(trim($record[2])); |
||
| 35 | } |
||
| 36 | else{ |
||
| 37 | $parser->skipToNextLevel($depth); |
||
| 38 | return null; |
||
| 39 | } |
||
| 40 | |||
| 41 | |||
| 42 | $parser->forward(); |
||
| 43 | |||
| 44 | while (!$parser->eof()) { |
||
| 45 | $record = $parser->getCurrentLineRecord(); |
||
| 46 | $recordType = strtoupper(trim($record[1])); |
||
| 47 | $currentDepth = (int)$record[0]; |
||
| 48 | |||
| 49 | if ($currentDepth <= $depth) { |
||
| 50 | $parser->back(); |
||
| 51 | break; |
||
| 52 | } |
||
| 53 | |||
| 54 | switch ($recordType) { |
||
| 55 | default: |
||
| 56 | $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); |
||
| 57 | } |
||
| 58 | |||
| 59 | $parser->forward(); |
||
| 60 | } |
||
| 61 | |||
| 62 | return $phone; |
||
| 63 | } |
||
| 65 |