Skip to content

Commit

Permalink
Mock classes with new in initializers
Browse files Browse the repository at this point in the history
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
  • Loading branch information
ghostwriter committed Jan 11, 2022
1 parent 8038245 commit 6c5cb03
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ protected function renderParams(Method $method, $config)

if (!$param->isVariadic()) {
if (false !== $param->isDefaultValueAvailable()) {
$paramDef .= ' = ' . var_export($param->getDefaultValue(), true);
$defaultValue = $param->getDefaultValue();
$paramDef .= ' = ' . (is_object($defaultValue) ? get_class($defaultValue) : var_export($defaultValue, true));
} elseif ($param->isOptional()) {
$paramDef .= ' = null';
}
Expand Down

0 comments on commit 6c5cb03

Please sign in to comment.