Skip to content

Commit

Permalink
Allow empty age tags
Browse files Browse the repository at this point in the history
  • Loading branch information
albarin committed Dec 30, 2024
1 parent 2acf76f commit c00ef28
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Parser/Indi/Even.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static function parse(\Gedcom\Parser $parser)
$even->setCaus(trim((string) $record[2]));
break;
case 'AGE':
$even->setAge(trim((string) $record[2]));
$even->setAge($record);
break;
case 'AGNC':
$even->setAgnc(trim((string) $record[2]));
Expand Down
8 changes: 6 additions & 2 deletions src/Record/Indi/Even.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,13 @@ public function getAddr()
*
* @return Even
*/
public function setAge($age = '')
public function setAge($record)
{
$this->age = $age;
if (isset($record[2])) {
$this->age = trim($record[2]);
} else {
$this->age = '';
}

return $this;
}
Expand Down

0 comments on commit c00ef28

Please sign in to comment.