Skip to content

Commit

Permalink
Fix for return values from getErrorLog()
Browse files Browse the repository at this point in the history
  • Loading branch information
agentrickard committed Sep 8, 2022
1 parent a525f5b commit f0d3e48
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/Commands/TesterCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,22 @@ protected function setErrorStorage($path) {
* @return mixed|null
*/
public function getErrorLog($path, $value) {
return $this->errorLog[$path][$value] ?: NULL;
$return = NULL;

// The default returns must match set types.
switch ($value) {
case 'response':
$return = $this->errorLog[$path][$value] ?: NULL;
break;
case 'errors':
$return = $this->errorLog[$path][$value] ?: [];
break;
default:
$return = $this->errorLog[$path][$value] ?: 0;
break;
}

return $return;
}

/**
Expand Down

0 comments on commit f0d3e48

Please sign in to comment.