From c0eb7e2d7e25a7a7060eae32df09d10605b357c0 Mon Sep 17 00:00:00 2001 From: Martin Wachocki Date: Wed, 8 Oct 2014 10:06:59 -0400 Subject: [PATCH] Fix for functions with variadic arguments The `php artisan ide-helper:generate` command fails with the following error for functions with variadic arguments: [ReflectionException] Internal error: Failed to retrieve the default value --- src/Method.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Method.php b/src/Method.php index 4b8ef12..4e4376c 100644 --- a/src/Method.php +++ b/src/Method.php @@ -261,7 +261,7 @@ class Method $paramStr = '$' . $param->getName(); $params[] = $paramStr; if ($param->isOptional()) { - $default = $param->getDefaultValue(); + $default = $param->isDefaultValueAvailable() ? $param->getDefaultValue() : null; if (is_bool($default)) { $default = $default ? 'true' : 'false'; } elseif (is_array($default)) {