Skip to content

Commit

Permalink
increase code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
cnizzardini committed Jun 25, 2021
1 parent df7bff2 commit d1e357a
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/Welcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ private function database()
$errorMsg = $connectionError->getMessage();
if (method_exists($connectionError, 'getAttributes')) {
$attributes = $connectionError->getAttributes();
if (isset($errorMsg['message'])) {
$errorMsg .= '. ' . $attributes['message'];
}
$errorMsg .= $attributes['message'] ?? '';
}

return $errorMsg ?? 'unknown error / unable to connect';
Expand Down Expand Up @@ -159,13 +157,14 @@ private function whichMixerApiVersion(): string
try {
return InstalledVersions::getPrettyVersion('mixerapi/mixerapi');
} catch (\Exception $e) {
try {
return InstalledVersions::getPrettyVersion('mixerapi/mixerapi-dev');
// the following should not be possible:
// @codeCoverageIgnoreStart
} catch (\Exception $e) {
throw new RuntimeException('Package mixerapi/mixerapi is not installed');
}
// @codeCoverageIgnoreEnd
}

try {
return InstalledVersions::getPrettyVersion('mixerapi/mixerapi-dev');
} catch (\Exception $e) {
}

throw new RuntimeException('Package mixerapi/mixerapi is not installed');
}
}

0 comments on commit d1e357a

Please sign in to comment.