From 66f6d4b1ea44763ba482af23e874d9ce39461383 Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Tue, 10 Jul 2018 13:01:44 -0700 Subject: [PATCH] Allow empty default of `0` for optional parameter in magic method (#880) Fixes #879 `!= ''` will reject both null and '', but not `0` --- src/Psalm/Checker/CommentChecker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Psalm/Checker/CommentChecker.php b/src/Psalm/Checker/CommentChecker.php index 9eccddd0e..1b1e39b90 100644 --- a/src/Psalm/Checker/CommentChecker.php +++ b/src/Psalm/Checker/CommentChecker.php @@ -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) {