1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Allow empty default of 0 for optional parameter in magic method (#880)

Fixes #879

`!= ''` will reject both null and '', but not `0`
This commit is contained in:
Tyson Andre 2018-07-10 13:01:44 -07:00 committed by Matthew Brown
parent 5bb5bb2476
commit 66f6d4b1ea

View File

@ -467,7 +467,7 @@ class CommentChecker
$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) {