Skip to content

Commit

Permalink
Merge pull request #64 from albarin/allow-empty-age
Browse files Browse the repository at this point in the history
Allow empty age tags
  • Loading branch information
curtisdelicata authored Jan 11, 2025
2 parents 75c290d + c00ef28 commit 4f5c610
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 4f5c610

Please sign in to comment.