Skip to content

Commit

Permalink
[zendframework#5125] Trim default vale at assignment time
Browse files Browse the repository at this point in the history
  • Loading branch information
Maks3w committed Nov 18, 2013
1 parent 0d90a63 commit c6aceeb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion library/Zend/Code/Scanner/ParameterScanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ protected function scan()
}

if ($this->name !== null) {
$this->defaultValue .= (is_string($token)) ? $token : $token[1];
$this->defaultValue .= trim((is_string($token)) ? $token : $token[1]);
}

SCANNER_CONTINUE:
Expand Down
2 changes: 1 addition & 1 deletion tests/ZendTest/Code/Scanner/MethodScannerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ public function testMethodScannerMethodSignatureLatestOptionalParamHasParenthese
$method = $class->getMethod('four');
$paramTwo = $method->getParameter(1);
$optionalValue = $paramTwo->getDefaultValue();
$this->assertEquals('array(array(array(\'default\')))', trim($optionalValue));
$this->assertEquals('array(array(array(\'default\')))', $optionalValue);
}
}

0 comments on commit c6aceeb

Please sign in to comment.