New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: check for empty postParseEvent ccda import #7348
Conversation
@@ -97,7 +97,9 @@ public function parseCDAEntryComponents($components): array | |||
} | |||
} | |||
} | |||
$this->templateData = $postParseEvent->getTemplateData(); | |||
if (!empty($postParseEvent)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does empty() function work on objects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be safer to check the instance type. Empty will work, but if someone returns a string or something other than an object having a getTemplateData() method this will blow up
if ($postParseEvent instanceof CDAPostParseEvent)
remaining errors from native ccda export to ccda import:
|
@stephenwaite Are you wanting your PR to address those remaining errors or is it ok to bring this in? I can bump this to the next patch if you are still working on it, otherwise this looks fine to me to bring this in. |
* fix: check for empty postParseEvent * check instance type too * fix php warns and deprecates (cherry picked from commit f633bd3)
Fixes #7347
Short description of what this resolves:
Changes proposed in this pull request: