This function relies on an external data feed. If it fails to fetch the feed, then we
wind up with a PHP warning:
```
Invalid argument supplied for foreach() in CRM_Utils_Check_Component_Env->checkVersion()
(line 475 of /home/me/bknix/build/dmaster/web/sites/all/modules/civicrm/CRM/Utils/Check/Component/Env.php).
```
In certain unit-tests, this warning becomes a false-negative test-failure.
I saw these tests failing recently:
```
CRM_Contact_Page_View_UserDashBoardTest.testDashboardContentContributionsWithInvoicingEnabled
CRM_Contact_Page_View_UserDashBoardTest.testDashboardContentContributions
CRM_Core_Page_HookTest.testFormsCallBuildFormOnce
CRM_Core_Page_HookTest.testPagesCallPageRunOnce
```
Note that it is legit to have some QA signals if the web-service fials, but
that's more of a monitoring issue for the web-service. It shouldn't
manifest in random unit-tests or random page-views.
'warning' => CRM_Utils_Check::severityMap(\Psr\Log\LogLevel::WARNING) ,
'critical' => CRM_Utils_Check::severityMap(\Psr\Log\LogLevel::CRITICAL),
];
- foreach ($vc->getVersionMessages() as $msg) {
+ foreach ($vc->getVersionMessages() ?? [] as $msg) {
$messages[] = new CRM_Utils_Check_Message(__FUNCTION__ . '_' . $msg['name'],
$msg['message'], $msg['title'], $severities[$msg['severity']], 'fa-cloud-upload');
}