Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to generate setter and getter return type from short doc block #21

Open
Serhii-DV opened this issue Apr 11, 2019 · 2 comments
Open

Comments

@Serhii-DV
Copy link

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.

@ScorpioT1000
Copy link

Same problem

@avfletch
Copy link

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants