@@ -30,14 +30,14 @@ |
||
| 30 | 30 | $record = $parser->getCurrentLineRecord(); |
| 31 | 31 | $depth = (int)$record[0]; |
| 32 | 32 | if(isset($record[1])){ |
| 33 | - $className = '\\PhpGedcom\\Record\\Indi\\' . ucfirst(strtolower(trim($record[1]))); |
|
| 34 | - $attr = new $className(); |
|
| 33 | + $className = '\\PhpGedcom\\Record\\Indi\\' . ucfirst(strtolower(trim($record[1]))); |
|
| 34 | + $attr = new $className(); |
|
| 35 | 35 | |
| 36 | - $attr->setType(trim($record[1])); |
|
| 36 | + $attr->setType(trim($record[1])); |
|
| 37 | 37 | } |
| 38 | 38 | else{ |
| 39 | - $parser->skipToNextLevel($depth); |
|
| 40 | - return null; |
|
| 39 | + $parser->skipToNextLevel($depth); |
|
| 40 | + return null; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | if (isset($record[2])) { |
@@ -28,14 +28,14 @@ discard block |
||
| 28 | 28 | public static function parse(\PhpGedcom\Parser $parser) |
| 29 | 29 | { |
| 30 | 30 | $record = $parser->getCurrentLineRecord(); |
| 31 | - $depth = (int)$record[0]; |
|
| 32 | - if(isset($record[1])){ |
|
| 33 | - $className = '\\PhpGedcom\\Record\\Indi\\' . ucfirst(strtolower(trim($record[1]))); |
|
| 31 | + $depth = (int) $record[0]; |
|
| 32 | + if (isset($record[1])) { |
|
| 33 | + $className = '\\PhpGedcom\\Record\\Indi\\'.ucfirst(strtolower(trim($record[1]))); |
|
| 34 | 34 | $attr = new $className(); |
| 35 | 35 | |
| 36 | 36 | $attr->setType(trim($record[1])); |
| 37 | 37 | } |
| 38 | - else{ |
|
| 38 | + else { |
|
| 39 | 39 | $parser->skipToNextLevel($depth); |
| 40 | 40 | return null; |
| 41 | 41 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | while (!$parser->eof()) { |
| 50 | 50 | $record = $parser->getCurrentLineRecord(); |
| 51 | 51 | $recordType = strtoupper(trim($record[1])); |
| 52 | - $currentDepth = (int)$record[0]; |
|
| 52 | + $currentDepth = (int) $record[0]; |
|
| 53 | 53 | |
| 54 | 54 | if ($currentDepth <= $depth) { |
| 55 | 55 | $parser->back(); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | break; |
| 100 | 100 | default: |
| 101 | - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); |
|
| 101 | + $parser->logUnhandledRecord(get_class().' @ '.__LINE__); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | $parser->forward(); |
@@ -34,8 +34,7 @@ |
||
| 34 | 34 | $attr = new $className(); |
| 35 | 35 | |
| 36 | 36 | $attr->setType(trim($record[1])); |
| 37 | - } |
|
| 38 | - else{ |
|
| 37 | + } else{ |
|
| 39 | 38 | $parser->skipToNextLevel($depth); |
| 40 | 39 | return null; |
| 41 | 40 | } |
@@ -30,12 +30,12 @@ |
||
| 30 | 30 | $record = $parser->getCurrentLineRecord(); |
| 31 | 31 | $depth = (int)$record[0]; |
| 32 | 32 | if(isset($record[2])){ |
| 33 | - $romn = new \PhpGedcom\Record\Indi\Name\Romn(); |
|
| 34 | - $romn->setRomn(trim($record[2])); |
|
| 33 | + $romn = new \PhpGedcom\Record\Indi\Name\Romn(); |
|
| 34 | + $romn->setRomn(trim($record[2])); |
|
| 35 | 35 | } |
| 36 | 36 | else{ |
| 37 | - $parser->skipToNextLevel($depth); |
|
| 38 | - return null; |
|
| 37 | + $parser->skipToNextLevel($depth); |
|
| 38 | + return null; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
@@ -28,12 +28,12 @@ discard block |
||
| 28 | 28 | public static function parse(\PhpGedcom\Parser $parser) |
| 29 | 29 | { |
| 30 | 30 | $record = $parser->getCurrentLineRecord(); |
| 31 | - $depth = (int)$record[0]; |
|
| 32 | - if(isset($record[2])){ |
|
| 31 | + $depth = (int) $record[0]; |
|
| 32 | + if (isset($record[2])) { |
|
| 33 | 33 | $romn = new \PhpGedcom\Record\Indi\Name\Romn(); |
| 34 | 34 | $romn->setRomn(trim($record[2])); |
| 35 | 35 | } |
| 36 | - else{ |
|
| 36 | + else { |
|
| 37 | 37 | $parser->skipToNextLevel($depth); |
| 38 | 38 | return null; |
| 39 | 39 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | while (!$parser->eof()) { |
| 45 | 45 | $record = $parser->getCurrentLineRecord(); |
| 46 | 46 | $recordType = strtoupper(trim($record[1])); |
| 47 | - $currentDepth = (int)$record[0]; |
|
| 47 | + $currentDepth = (int) $record[0]; |
|
| 48 | 48 | |
| 49 | 49 | if ($currentDepth <= $depth) { |
| 50 | 50 | $parser->back(); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $romn->setNsfx(trim($record[2])); |
| 79 | 79 | break; |
| 80 | 80 | default: |
| 81 | - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); |
|
| 81 | + $parser->logUnhandledRecord(get_class().' @ '.__LINE__); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | $parser->forward(); |
@@ -32,8 +32,7 @@ |
||
| 32 | 32 | if(isset($record[2])){ |
| 33 | 33 | $romn = new \PhpGedcom\Record\Indi\Name\Romn(); |
| 34 | 34 | $romn->setRomn(trim($record[2])); |
| 35 | - } |
|
| 36 | - else{ |
|
| 35 | + } else{ |
|
| 37 | 36 | $parser->skipToNextLevel($depth); |
| 38 | 37 | return null; |
| 39 | 38 | } |
@@ -30,11 +30,11 @@ |
||
| 30 | 30 | $record = $parser->getCurrentLineRecord(); |
| 31 | 31 | $depth = (int)$record[0]; |
| 32 | 32 | if(isset($record[2])){ |
| 33 | - $fone = new \PhpGedcom\Record\Indi\Name\Fone(); |
|
| 34 | - $fone->setFone(trim($record[2])); |
|
| 33 | + $fone = new \PhpGedcom\Record\Indi\Name\Fone(); |
|
| 34 | + $fone->setFone(trim($record[2])); |
|
| 35 | 35 | } |
| 36 | 36 | else{ |
| 37 | - return null; |
|
| 37 | + return null; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | |
@@ -28,12 +28,12 @@ discard block |
||
| 28 | 28 | public static function parse(\PhpGedcom\Parser $parser) |
| 29 | 29 | { |
| 30 | 30 | $record = $parser->getCurrentLineRecord(); |
| 31 | - $depth = (int)$record[0]; |
|
| 32 | - if(isset($record[2])){ |
|
| 31 | + $depth = (int) $record[0]; |
|
| 32 | + if (isset($record[2])) { |
|
| 33 | 33 | $fone = new \PhpGedcom\Record\Indi\Name\Fone(); |
| 34 | 34 | $fone->setFone(trim($record[2])); |
| 35 | 35 | } |
| 36 | - else{ |
|
| 36 | + else { |
|
| 37 | 37 | return null; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | while (!$parser->eof()) { |
| 44 | 44 | $record = $parser->getCurrentLineRecord(); |
| 45 | 45 | $recordType = strtoupper(trim($record[1])); |
| 46 | - $currentDepth = (int)$record[0]; |
|
| 46 | + $currentDepth = (int) $record[0]; |
|
| 47 | 47 | |
| 48 | 48 | if ($currentDepth <= $depth) { |
| 49 | 49 | $parser->back(); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $fone->setNsfx(trim($record[2])); |
| 78 | 78 | break; |
| 79 | 79 | default: |
| 80 | - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); |
|
| 80 | + $parser->logUnhandledRecord(get_class().' @ '.__LINE__); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | $parser->forward(); |
@@ -32,8 +32,7 @@ |
||
| 32 | 32 | if(isset($record[2])){ |
| 33 | 33 | $fone = new \PhpGedcom\Record\Indi\Name\Fone(); |
| 34 | 34 | $fone->setFone(trim($record[2])); |
| 35 | - } |
|
| 36 | - else{ |
|
| 35 | + } else{ |
|
| 37 | 36 | return null; |
| 38 | 37 | } |
| 39 | 38 | |
@@ -28,10 +28,10 @@ discard block |
||
| 28 | 28 | public static function parse(\PhpGedcom\Parser $parser) |
| 29 | 29 | { |
| 30 | 30 | $record = $parser->getCurrentLineRecord(); |
| 31 | - $depth = (int)$record[0]; |
|
| 31 | + $depth = (int) $record[0]; |
|
| 32 | 32 | |
| 33 | 33 | if (count($record) < 3) { |
| 34 | - $parser->logSkippedRecord('Missing family information; ' . get_class(), ' @ ' . __LINE__); |
|
| 34 | + $parser->logSkippedRecord('Missing family information; '.get_class(), ' @ '.__LINE__); |
|
| 35 | 35 | $parser->skipToNextLevel($depth); |
| 36 | 36 | return null; |
| 37 | 37 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | while (!$parser->eof()) { |
| 47 | 47 | $record = $parser->getCurrentLineRecord(); |
| 48 | 48 | $recordType = strtoupper(trim($record[1])); |
| 49 | - $currentDepth = (int)$record[0]; |
|
| 49 | + $currentDepth = (int) $record[0]; |
|
| 50 | 50 | |
| 51 | 51 | if ($currentDepth <= $depth) { |
| 52 | 52 | $parser->back(); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | break; |
| 66 | 66 | default: |
| 67 | - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); |
|
| 67 | + $parser->logUnhandledRecord(get_class().' @ '.__LINE__); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | $parser->forward(); |
@@ -30,12 +30,12 @@ |
||
| 30 | 30 | $record = $parser->getCurrentLineRecord(); |
| 31 | 31 | $depth = (int)$record[0]; |
| 32 | 32 | if(isset($record[2])){ |
| 33 | - $asso = new \PhpGedcom\Record\Indi\Asso(); |
|
| 34 | - $asso->setIndi($parser->normalizeIdentifier($record[2])); |
|
| 33 | + $asso = new \PhpGedcom\Record\Indi\Asso(); |
|
| 34 | + $asso->setIndi($parser->normalizeIdentifier($record[2])); |
|
| 35 | 35 | } |
| 36 | 36 | else{ |
| 37 | - $parser->skipToNextLevel($depth); |
|
| 38 | - return null; |
|
| 37 | + $parser->skipToNextLevel($depth); |
|
| 38 | + return null; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
@@ -28,12 +28,12 @@ discard block |
||
| 28 | 28 | public static function parse(\PhpGedcom\Parser $parser) |
| 29 | 29 | { |
| 30 | 30 | $record = $parser->getCurrentLineRecord(); |
| 31 | - $depth = (int)$record[0]; |
|
| 32 | - if(isset($record[2])){ |
|
| 31 | + $depth = (int) $record[0]; |
|
| 32 | + if (isset($record[2])) { |
|
| 33 | 33 | $asso = new \PhpGedcom\Record\Indi\Asso(); |
| 34 | 34 | $asso->setIndi($parser->normalizeIdentifier($record[2])); |
| 35 | 35 | } |
| 36 | - else{ |
|
| 36 | + else { |
|
| 37 | 37 | $parser->skipToNextLevel($depth); |
| 38 | 38 | return null; |
| 39 | 39 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | while (!$parser->eof()) { |
| 45 | 45 | $record = $parser->getCurrentLineRecord(); |
| 46 | 46 | $recordType = strtoupper(trim($record[1])); |
| 47 | - $currentDepth = (int)$record[0]; |
|
| 47 | + $currentDepth = (int) $record[0]; |
|
| 48 | 48 | |
| 49 | 49 | if ($currentDepth <= $depth) { |
| 50 | 50 | $parser->back(); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | break; |
| 68 | 68 | default: |
| 69 | - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); |
|
| 69 | + $parser->logUnhandledRecord(get_class().' @ '.__LINE__); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | $parser->forward(); |
@@ -32,8 +32,7 @@ |
||
| 32 | 32 | if(isset($record[2])){ |
| 33 | 33 | $asso = new \PhpGedcom\Record\Indi\Asso(); |
| 34 | 34 | $asso->setIndi($parser->normalizeIdentifier($record[2])); |
| 35 | - } |
|
| 36 | - else{ |
|
| 35 | + } else{ |
|
| 37 | 36 | $parser->skipToNextLevel($depth); |
| 38 | 37 | return null; |
| 39 | 38 | } |
@@ -23,14 +23,14 @@ |
||
| 23 | 23 | public static function parseAdop($parser, $even) |
| 24 | 24 | { |
| 25 | 25 | $record = $parser->getCurrentLineRecord(); |
| 26 | - if(isset($record[1])) |
|
| 26 | + if (isset($record[1])) |
|
| 27 | 27 | $even->setAdop(trim($record[2])); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | public static function parseFamc($parser, $even) |
| 31 | 31 | { |
| 32 | 32 | $record = $parser->getCurrentLineRecord(); |
| 33 | - if(isset($record[1])) |
|
| 33 | + if (isset($record[1])) |
|
| 34 | 34 | $even->setFamc(trim($record[2])); |
| 35 | 35 | } |
| 36 | 36 | } |
@@ -23,14 +23,16 @@ |
||
| 23 | 23 | public static function parseAdop($parser, $even) |
| 24 | 24 | { |
| 25 | 25 | $record = $parser->getCurrentLineRecord(); |
| 26 | - if(isset($record[1])) |
|
| 27 | - $even->setAdop(trim($record[2])); |
|
| 26 | + if(isset($record[1])) { |
|
| 27 | + $even->setAdop(trim($record[2])); |
|
| 28 | + } |
|
| 28 | 29 | } |
| 29 | 30 | |
| 30 | 31 | public static function parseFamc($parser, $even) |
| 31 | 32 | { |
| 32 | 33 | $record = $parser->getCurrentLineRecord(); |
| 33 | - if(isset($record[1])) |
|
| 34 | - $even->setFamc(trim($record[2])); |
|
| 34 | + if(isset($record[1])) { |
|
| 35 | + $even->setFamc(trim($record[2])); |
|
| 36 | + } |
|
| 35 | 37 | } |
| 36 | 38 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | public static function parse(\PhpGedcom\Parser $parser) |
| 29 | 29 | { |
| 30 | 30 | $record = $parser->getCurrentLineRecord(); |
| 31 | - $depth = (int)$record[0]; |
|
| 31 | + $depth = (int) $record[0]; |
|
| 32 | 32 | |
| 33 | 33 | $plac = new \PhpGedcom\Record\Indi\Even\Plac(); |
| 34 | 34 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | while (!$parser->eof()) { |
| 42 | 42 | $record = $parser->getCurrentLineRecord(); |
| 43 | 43 | $recordType = strtoupper(trim($record[1])); |
| 44 | - $currentDepth = (int)$record[0]; |
|
| 44 | + $currentDepth = (int) $record[0]; |
|
| 45 | 45 | |
| 46 | 46 | if ($currentDepth <= $depth) { |
| 47 | 47 | $parser->back(); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $plac->addSour($sour); |
| 64 | 64 | break; |
| 65 | 65 | default: |
| 66 | - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); |
|
| 66 | + $parser->logUnhandledRecord(get_class().' @ '.__LINE__); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | $parser->forward(); |
@@ -22,30 +22,30 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | class Even extends \PhpGedcom\Parser\Component { |
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * |
|
| 27 | - * |
|
| 28 | - */ |
|
| 29 | - public static function parse(\PhpGedcom\Parser $parser) { |
|
| 30 | - $record = $parser->getCurrentLineRecord(); |
|
| 31 | - $depth = (int) $record[0]; |
|
| 32 | - if (empty($record[1])) { |
|
| 33 | - $parser->skipToNextLevel($depth); |
|
| 34 | - return null; |
|
| 35 | - } |
|
| 25 | + /** |
|
| 26 | + * |
|
| 27 | + * |
|
| 28 | + */ |
|
| 29 | + public static function parse(\PhpGedcom\Parser $parser) { |
|
| 30 | + $record = $parser->getCurrentLineRecord(); |
|
| 31 | + $depth = (int) $record[0]; |
|
| 32 | + if (empty($record[1])) { |
|
| 33 | + $parser->skipToNextLevel($depth); |
|
| 34 | + return null; |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - $even = null; |
|
| 37 | + $even = null; |
|
| 38 | 38 | |
| 39 | - if (strtoupper(trim($record[1])) != 'EVEN') { |
|
| 40 | - $className = '\\PhpGedcom\\Record\\Indi\\' . ucfirst(strtolower(trim($record[1]))); |
|
| 41 | - $even = new $className(); |
|
| 42 | - } else { |
|
| 43 | - $even = new \PhpGedcom\Record\Indi\Even(); |
|
| 44 | - } |
|
| 39 | + if (strtoupper(trim($record[1])) != 'EVEN') { |
|
| 40 | + $className = '\\PhpGedcom\\Record\\Indi\\' . ucfirst(strtolower(trim($record[1]))); |
|
| 41 | + $even = new $className(); |
|
| 42 | + } else { |
|
| 43 | + $even = new \PhpGedcom\Record\Indi\Even(); |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - if (isset($record[1]) && strtoupper(trim($record[1])) != 'EVEN') { |
|
| 47 | - $even->setType(trim($record[1])); |
|
| 48 | - } |
|
| 46 | + if (isset($record[1]) && strtoupper(trim($record[1])) != 'EVEN') { |
|
| 47 | + $even->setType(trim($record[1])); |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | 50 | // ensures we capture any data following the EVEN type |
| 51 | 51 | if (isset($record[2]) && !empty($record[2])) { |
@@ -54,78 +54,78 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | $parser->forward(); |
| 56 | 56 | |
| 57 | - while (!$parser->eof()) { |
|
| 58 | - $record = $parser->getCurrentLineRecord(); |
|
| 59 | - $recordType = strtoupper(trim($record[1])); |
|
| 60 | - $currentDepth = (int) $record[0]; |
|
| 57 | + while (!$parser->eof()) { |
|
| 58 | + $record = $parser->getCurrentLineRecord(); |
|
| 59 | + $recordType = strtoupper(trim($record[1])); |
|
| 60 | + $currentDepth = (int) $record[0]; |
|
| 61 | 61 | |
| 62 | - if ($currentDepth <= $depth) { |
|
| 63 | - $parser->back(); |
|
| 64 | - break; |
|
| 65 | - } |
|
| 62 | + if ($currentDepth <= $depth) { |
|
| 63 | + $parser->back(); |
|
| 64 | + break; |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | - switch ($recordType) { |
|
| 68 | - case 'TYPE': |
|
| 69 | - $even->setType(trim($record[2])); |
|
| 70 | - break; |
|
| 71 | - case 'DATE': |
|
| 72 | - $dat = \PhpGedcom\Parser\Date::parse($parser); |
|
| 73 | - $even->setDate($dat); |
|
| 74 | - //$even->setDate(trim($record[2])) |
|
| 75 | - break; |
|
| 76 | - case 'PLAC': |
|
| 77 | - $plac = \PhpGedcom\Parser\Plac::parse($parser); |
|
| 78 | - $even->setPlac($plac); |
|
| 79 | - break; |
|
| 80 | - case 'ADDR': |
|
| 81 | - $even->setAddr(\PhpGedcom\Parser\Addr::parse($parser)); |
|
| 82 | - break; |
|
| 83 | - case 'PHON': |
|
| 84 | - $phone = \PhpGedcom\Parser\Phon::parse($parser); |
|
| 85 | - $even->addPhone($phone); |
|
| 86 | - break; |
|
| 87 | - case 'CAUS': |
|
| 88 | - $even->setCaus(trim($record[2])); |
|
| 89 | - break; |
|
| 90 | - case 'AGE': |
|
| 91 | - $even->setAge(trim($record[2])); |
|
| 92 | - break; |
|
| 93 | - case 'AGNC': |
|
| 94 | - $even->setAgnc(trim($record[2])); |
|
| 95 | - break; |
|
| 96 | - case 'SOUR': |
|
| 97 | - $sour = \PhpGedcom\Parser\SourRef::parse($parser); |
|
| 98 | - $even->addSour($sour); |
|
| 99 | - break; |
|
| 100 | - case 'OBJE': |
|
| 101 | - $obje = \PhpGedcom\Parser\ObjeRef::parse($parser); |
|
| 102 | - $even->addObje($obje); |
|
| 103 | - break; |
|
| 104 | - case 'NOTE': |
|
| 105 | - $note = \PhpGedcom\Parser\NoteRef::parse($parser); |
|
| 106 | - if ($note) { |
|
| 107 | - $even->addNote($note); |
|
| 108 | - } |
|
| 109 | - break; |
|
| 110 | - case 'CHAN': |
|
| 111 | - $change = Chan::parse($parser); |
|
| 112 | - $even->setChan($change); |
|
| 113 | - break; |
|
| 114 | - default: |
|
| 115 | - $self = get_called_class(); |
|
| 116 | - $method = 'parse' . $recordType; |
|
| 67 | + switch ($recordType) { |
|
| 68 | + case 'TYPE': |
|
| 69 | + $even->setType(trim($record[2])); |
|
| 70 | + break; |
|
| 71 | + case 'DATE': |
|
| 72 | + $dat = \PhpGedcom\Parser\Date::parse($parser); |
|
| 73 | + $even->setDate($dat); |
|
| 74 | + //$even->setDate(trim($record[2])) |
|
| 75 | + break; |
|
| 76 | + case 'PLAC': |
|
| 77 | + $plac = \PhpGedcom\Parser\Plac::parse($parser); |
|
| 78 | + $even->setPlac($plac); |
|
| 79 | + break; |
|
| 80 | + case 'ADDR': |
|
| 81 | + $even->setAddr(\PhpGedcom\Parser\Addr::parse($parser)); |
|
| 82 | + break; |
|
| 83 | + case 'PHON': |
|
| 84 | + $phone = \PhpGedcom\Parser\Phon::parse($parser); |
|
| 85 | + $even->addPhone($phone); |
|
| 86 | + break; |
|
| 87 | + case 'CAUS': |
|
| 88 | + $even->setCaus(trim($record[2])); |
|
| 89 | + break; |
|
| 90 | + case 'AGE': |
|
| 91 | + $even->setAge(trim($record[2])); |
|
| 92 | + break; |
|
| 93 | + case 'AGNC': |
|
| 94 | + $even->setAgnc(trim($record[2])); |
|
| 95 | + break; |
|
| 96 | + case 'SOUR': |
|
| 97 | + $sour = \PhpGedcom\Parser\SourRef::parse($parser); |
|
| 98 | + $even->addSour($sour); |
|
| 99 | + break; |
|
| 100 | + case 'OBJE': |
|
| 101 | + $obje = \PhpGedcom\Parser\ObjeRef::parse($parser); |
|
| 102 | + $even->addObje($obje); |
|
| 103 | + break; |
|
| 104 | + case 'NOTE': |
|
| 105 | + $note = \PhpGedcom\Parser\NoteRef::parse($parser); |
|
| 106 | + if ($note) { |
|
| 107 | + $even->addNote($note); |
|
| 108 | + } |
|
| 109 | + break; |
|
| 110 | + case 'CHAN': |
|
| 111 | + $change = Chan::parse($parser); |
|
| 112 | + $even->setChan($change); |
|
| 113 | + break; |
|
| 114 | + default: |
|
| 115 | + $self = get_called_class(); |
|
| 116 | + $method = 'parse' . $recordType; |
|
| 117 | 117 | |
| 118 | - if (method_exists($self, $method)) { |
|
| 119 | - $self::$method($parser, $even); |
|
| 120 | - } else { |
|
| 121 | - $parser->logUnhandledRecord($self . ' @ ' . __LINE__); |
|
| 122 | - $parser->skipToNextLevel($currentDepth); |
|
| 123 | - } |
|
| 124 | - } |
|
| 118 | + if (method_exists($self, $method)) { |
|
| 119 | + $self::$method($parser, $even); |
|
| 120 | + } else { |
|
| 121 | + $parser->logUnhandledRecord($self . ' @ ' . __LINE__); |
|
| 122 | + $parser->skipToNextLevel($currentDepth); |
|
| 123 | + } |
|
| 124 | + } |
|
| 125 | 125 | |
| 126 | - $parser->forward(); |
|
| 127 | - } |
|
| 126 | + $parser->forward(); |
|
| 127 | + } |
|
| 128 | 128 | |
| 129 | - return $even; |
|
| 130 | - } |
|
| 129 | + return $even; |
|
| 130 | + } |
|
| 131 | 131 | } |
@@ -65,62 +65,62 @@ |
||
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | switch ($recordType) { |
| 68 | - case 'TYPE': |
|
| 69 | - $even->setType(trim($record[2])); |
|
| 70 | - break; |
|
| 71 | - case 'DATE': |
|
| 72 | - $dat = \PhpGedcom\Parser\Date::parse($parser); |
|
| 73 | - $even->setDate($dat); |
|
| 74 | - //$even->setDate(trim($record[2])) |
|
| 75 | - break; |
|
| 76 | - case 'PLAC': |
|
| 77 | - $plac = \PhpGedcom\Parser\Plac::parse($parser); |
|
| 78 | - $even->setPlac($plac); |
|
| 79 | - break; |
|
| 80 | - case 'ADDR': |
|
| 81 | - $even->setAddr(\PhpGedcom\Parser\Addr::parse($parser)); |
|
| 82 | - break; |
|
| 83 | - case 'PHON': |
|
| 84 | - $phone = \PhpGedcom\Parser\Phon::parse($parser); |
|
| 85 | - $even->addPhone($phone); |
|
| 86 | - break; |
|
| 87 | - case 'CAUS': |
|
| 88 | - $even->setCaus(trim($record[2])); |
|
| 89 | - break; |
|
| 90 | - case 'AGE': |
|
| 91 | - $even->setAge(trim($record[2])); |
|
| 92 | - break; |
|
| 93 | - case 'AGNC': |
|
| 94 | - $even->setAgnc(trim($record[2])); |
|
| 95 | - break; |
|
| 96 | - case 'SOUR': |
|
| 97 | - $sour = \PhpGedcom\Parser\SourRef::parse($parser); |
|
| 98 | - $even->addSour($sour); |
|
| 99 | - break; |
|
| 100 | - case 'OBJE': |
|
| 101 | - $obje = \PhpGedcom\Parser\ObjeRef::parse($parser); |
|
| 102 | - $even->addObje($obje); |
|
| 103 | - break; |
|
| 104 | - case 'NOTE': |
|
| 105 | - $note = \PhpGedcom\Parser\NoteRef::parse($parser); |
|
| 106 | - if ($note) { |
|
| 107 | - $even->addNote($note); |
|
| 108 | - } |
|
| 109 | - break; |
|
| 110 | - case 'CHAN': |
|
| 111 | - $change = Chan::parse($parser); |
|
| 112 | - $even->setChan($change); |
|
| 113 | - break; |
|
| 114 | - default: |
|
| 115 | - $self = get_called_class(); |
|
| 116 | - $method = 'parse' . $recordType; |
|
| 68 | + case 'TYPE': |
|
| 69 | + $even->setType(trim($record[2])); |
|
| 70 | + break; |
|
| 71 | + case 'DATE': |
|
| 72 | + $dat = \PhpGedcom\Parser\Date::parse($parser); |
|
| 73 | + $even->setDate($dat); |
|
| 74 | + //$even->setDate(trim($record[2])) |
|
| 75 | + break; |
|
| 76 | + case 'PLAC': |
|
| 77 | + $plac = \PhpGedcom\Parser\Plac::parse($parser); |
|
| 78 | + $even->setPlac($plac); |
|
| 79 | + break; |
|
| 80 | + case 'ADDR': |
|
| 81 | + $even->setAddr(\PhpGedcom\Parser\Addr::parse($parser)); |
|
| 82 | + break; |
|
| 83 | + case 'PHON': |
|
| 84 | + $phone = \PhpGedcom\Parser\Phon::parse($parser); |
|
| 85 | + $even->addPhone($phone); |
|
| 86 | + break; |
|
| 87 | + case 'CAUS': |
|
| 88 | + $even->setCaus(trim($record[2])); |
|
| 89 | + break; |
|
| 90 | + case 'AGE': |
|
| 91 | + $even->setAge(trim($record[2])); |
|
| 92 | + break; |
|
| 93 | + case 'AGNC': |
|
| 94 | + $even->setAgnc(trim($record[2])); |
|
| 95 | + break; |
|
| 96 | + case 'SOUR': |
|
| 97 | + $sour = \PhpGedcom\Parser\SourRef::parse($parser); |
|
| 98 | + $even->addSour($sour); |
|
| 99 | + break; |
|
| 100 | + case 'OBJE': |
|
| 101 | + $obje = \PhpGedcom\Parser\ObjeRef::parse($parser); |
|
| 102 | + $even->addObje($obje); |
|
| 103 | + break; |
|
| 104 | + case 'NOTE': |
|
| 105 | + $note = \PhpGedcom\Parser\NoteRef::parse($parser); |
|
| 106 | + if ($note) { |
|
| 107 | + $even->addNote($note); |
|
| 108 | + } |
|
| 109 | + break; |
|
| 110 | + case 'CHAN': |
|
| 111 | + $change = Chan::parse($parser); |
|
| 112 | + $even->setChan($change); |
|
| 113 | + break; |
|
| 114 | + default: |
|
| 115 | + $self = get_called_class(); |
|
| 116 | + $method = 'parse' . $recordType; |
|
| 117 | 117 | |
| 118 | - if (method_exists($self, $method)) { |
|
| 119 | - $self::$method($parser, $even); |
|
| 120 | - } else { |
|
| 121 | - $parser->logUnhandledRecord($self . ' @ ' . __LINE__); |
|
| 122 | - $parser->skipToNextLevel($currentDepth); |
|
| 123 | - } |
|
| 118 | + if (method_exists($self, $method)) { |
|
| 119 | + $self::$method($parser, $even); |
|
| 120 | + } else { |
|
| 121 | + $parser->logUnhandledRecord($self . ' @ ' . __LINE__); |
|
| 122 | + $parser->skipToNextLevel($currentDepth); |
|
| 123 | + } |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | $parser->forward(); |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $even = null; |
| 38 | 38 | |
| 39 | 39 | if (strtoupper(trim($record[1])) != 'EVEN') { |
| 40 | - $className = '\\PhpGedcom\\Record\\Indi\\' . ucfirst(strtolower(trim($record[1]))); |
|
| 40 | + $className = '\\PhpGedcom\\Record\\Indi\\'.ucfirst(strtolower(trim($record[1]))); |
|
| 41 | 41 | $even = new $className(); |
| 42 | 42 | } else { |
| 43 | 43 | $even = new \PhpGedcom\Record\Indi\Even(); |
@@ -113,12 +113,12 @@ discard block |
||
| 113 | 113 | break; |
| 114 | 114 | default: |
| 115 | 115 | $self = get_called_class(); |
| 116 | - $method = 'parse' . $recordType; |
|
| 116 | + $method = 'parse'.$recordType; |
|
| 117 | 117 | |
| 118 | 118 | if (method_exists($self, $method)) { |
| 119 | 119 | $self::$method($parser, $even); |
| 120 | 120 | } else { |
| 121 | - $parser->logUnhandledRecord($self . ' @ ' . __LINE__); |
|
| 121 | + $parser->logUnhandledRecord($self.' @ '.__LINE__); |
|
| 122 | 122 | $parser->skipToNextLevel($currentDepth); |
| 123 | 123 | } |
| 124 | 124 | } |
@@ -30,12 +30,12 @@ |
||
| 30 | 30 | $record = $parser->getCurrentLineRecord(); |
| 31 | 31 | $depth = (int)$record[0]; |
| 32 | 32 | if(isset($record[2])){ |
| 33 | - $name = new \PhpGedcom\Record\Indi\Name(); |
|
| 34 | - $name->setName(trim($record[2])); |
|
| 33 | + $name = new \PhpGedcom\Record\Indi\Name(); |
|
| 34 | + $name->setName(trim($record[2])); |
|
| 35 | 35 | } |
| 36 | 36 | else{ |
| 37 | - $parser->skipToNextLevel($depth); |
|
| 38 | - return null; |
|
| 37 | + $parser->skipToNextLevel($depth); |
|
| 38 | + return null; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
@@ -28,12 +28,12 @@ discard block |
||
| 28 | 28 | public static function parse(\PhpGedcom\Parser $parser) |
| 29 | 29 | { |
| 30 | 30 | $record = $parser->getCurrentLineRecord(); |
| 31 | - $depth = (int)$record[0]; |
|
| 32 | - if(isset($record[2])){ |
|
| 31 | + $depth = (int) $record[0]; |
|
| 32 | + if (isset($record[2])) { |
|
| 33 | 33 | $name = new \PhpGedcom\Record\Indi\Name(); |
| 34 | 34 | $name->setName(trim($record[2])); |
| 35 | 35 | } |
| 36 | - else{ |
|
| 36 | + else { |
|
| 37 | 37 | $parser->skipToNextLevel($depth); |
| 38 | 38 | return null; |
| 39 | 39 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | while (!$parser->eof()) { |
| 45 | 45 | $record = $parser->getCurrentLineRecord(); |
| 46 | 46 | $recordType = strtoupper(trim($record[1])); |
| 47 | - $currentDepth = (int)$record[0]; |
|
| 47 | + $currentDepth = (int) $record[0]; |
|
| 48 | 48 | |
| 49 | 49 | if ($currentDepth <= $depth) { |
| 50 | 50 | $parser->back(); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $name->setRomn(\PhpGedcom\Parser\Indi\Name\Romn::parse($parser)); |
| 95 | 95 | break; |
| 96 | 96 | default: |
| 97 | - $parser->logUnhandledRecord(get_class() . ' @ ' . __LINE__); |
|
| 97 | + $parser->logUnhandledRecord(get_class().' @ '.__LINE__); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | $parser->forward(); |
@@ -32,8 +32,7 @@ |
||
| 32 | 32 | if(isset($record[2])){ |
| 33 | 33 | $name = new \PhpGedcom\Record\Indi\Name(); |
| 34 | 34 | $name->setName(trim($record[2])); |
| 35 | - } |
|
| 36 | - else{ |
|
| 35 | + } else{ |
|
| 37 | 36 | $parser->skipToNextLevel($depth); |
| 38 | 37 | return null; |
| 39 | 38 | } |