Skip to content

Commit

Permalink
handle exception in ReflectionParameter::getDefaultValue
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalnature committed Jan 28, 2020
1 parent da0d2c0 commit 85512e0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ref.php
Original file line number Diff line number Diff line change
Expand Up @@ -2025,8 +2025,9 @@ protected function evaluate(&$subject, $specialStr = false){
$this->fmt->text('name', $paramName, $meta);

if($optional){
$paramValue = $parameter->isDefaultValueAvailable() ? $parameter->getDefaultValue() : null;
if ($paramValue !== null) {
try{
$paramValue = $parameter->isDefaultValueAvailable() ? $parameter->getDefaultValue() : null;
if($paramValue !== null){
$this->fmt->sep(' = ');

if(static::$env['is546'] && !$parameter->getDeclaringFunction()->isInternal() && $parameter->isDefaultValueConstant()){
Expand All @@ -2035,7 +2036,12 @@ protected function evaluate(&$subject, $specialStr = false){
}else{
$this->evaluate($paramValue, true);
}
}

}catch(\Exception $e){
// unable to retrieve default value?
}

}

$this->fmt->endContain();
Expand Down

0 comments on commit 85512e0

Please sign in to comment.