| Conditions | 6 |
| Paths | 17 |
| Total Lines | 40 |
| Code Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public static function convert(\PhpGedcom\Record\Head\Sour &$sour, $level) |
||
| 27 | { |
||
| 28 | $output = ''; |
||
| 29 | $_sour = $sour->getSour(); |
||
|
|
|||
| 30 | if ($_sour) { |
||
| 31 | $output .= $level.' SOUR '.$_sour."\n"; |
||
| 32 | } else { |
||
| 33 | return $output; |
||
| 34 | } |
||
| 35 | |||
| 36 | // level up |
||
| 37 | $level++; |
||
| 38 | |||
| 39 | // VERS |
||
| 40 | $vers = $sour->getVersion(); |
||
| 41 | if ($vers) { |
||
| 42 | $output .= $level.' VERS '.$vers."\n"; |
||
| 43 | } |
||
| 44 | |||
| 45 | // NAME |
||
| 46 | $name = $sour->getName(); |
||
| 47 | if ($name) { |
||
| 48 | $output .= $level.' NAME '.$name."\n"; |
||
| 49 | } |
||
| 50 | |||
| 51 | // CORP |
||
| 52 | $corp = $sour->getCorp(); |
||
| 53 | if ($corp) { |
||
| 54 | $_convert = \PhpGedcom\Writer\Head\Sour\Corp::convert($corp, $level); |
||
| 55 | $output .= $_convert; |
||
| 56 | } |
||
| 57 | |||
| 58 | // DATA |
||
| 59 | $data = $sour->getData(); |
||
| 60 | if ($data) { |
||
| 61 | $_convert = \PhpGedcom\Writer\Head\Sour\Data::convert($data, $level); |
||
| 62 | $output .= $_convert; |
||
| 63 | } |
||
| 64 | |||
| 65 | return $output; |
||
| 66 | } |
||
| 68 |