vscode-php-getters-setters
vscode-php-getters-setters copied to clipboard
Allow to generate setter and getter return type from short doc block
Now, it allows to generate right return type only for 'long' doc blocks, like this:
/**
* Some variable
*
* @var string
*/
private $var;
And it generates getter and setter method with string
return type.
But, it doesn't understand short
doc block version:
/** @var string */
private $var;
It generates with mixed
return type.
Same problem
I didn't have time to fix this in the TS and submit a PR for it but it's fairly trivial to patch the JS to work this way.
In Property.js change the for loop to use previousline not previousline - 1
and change the end of docblock detection to just use
// Reached the end of the doc block if (!text.includes('*')) {
That seems to "just work" for me, however dirty and hacky :)