Skip to content

Commit

Permalink
Allow empty default of 0 for optional parameter in magic method (#880)
Browse files Browse the repository at this point in the history
Fixes #879

`!= ''` will reject both null and '', but not `0`
  • Loading branch information
TysonAndre authored and muglug committed Jul 10, 2018
1 parent 5bb5bb2 commit 66f6d4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Psalm/Checker/CommentChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ public static function extractClassLikeDocblockInfo($comment, $line_number)
$args[] = ($method_tree_child->byref ? '&' : '')
. ($method_tree_child->variadic ? '...' : '')
. $method_tree_child->name
. ($method_tree_child->default ? ' = ' . $method_tree_child->default : '');
. ($method_tree_child->default != '' ? ' = ' . $method_tree_child->default : '');


if ($method_tree_child->children) {
Expand Down

0 comments on commit 66f6d4b

Please sign in to comment.