Closed adricorse closed 6 years ago
I'm sorry that one is normal. The reason is the following: If you have the following code:
function hello(b,a){
if (b > a) {
return false;
}
return true;
}
The return type will be boolean
.
It isn't obvious that this change always returns a boolean
as well:
function hello(b,a){
$bool = true;
if (b > a) {
$bool = false;
}
return $bool;
}
If you update the code the type
which was set will stay the same (for type and description), cause sometimes it isn't easily possible to determine the type, so I rely on the type
which is already inside the documentation. Hope you know what I mean, sorry for my bad explanation.
But, ideally, boolean can be changed to [[Type]], no ? Because if you replace your $bool = true by $bool = "ok"; (both $bool), return $bool is defined "boolean" again by your Doc
Hmm yeah that one will be fine :) I'll code that one in the next days.
Sorry don't know what you meant. Do you have an example for me?
Hello (Oh nooo ;) ) When you have already generate PHPDoc, take this exemple and you generate this :
The FuncDocr will generate this :
But, now, replace "true" with something else, like "$var" and you use shortcut to regenerate PHPDocs. The PHPDoc is again "return boolean".
But if you start by "return $var" and end by "return true", the PHPDoc is correct. Good luck ;)