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

Protected/Private Attributes marked methods are not included in the model docBlock #1293

Open
viicslen opened this issue Jan 5, 2022 · 6 comments
Labels

Comments

@viicslen
Copy link

viicslen commented Jan 5, 2022

Versions:

  • ide-helper Version: dev-master
  • Laravel Version: 8.78.1
  • PHP Version: 8.0.13

Description:

As described in the pull request attribute marked methods should be protected which makes them not discoverable by the the ModelsCommand.

Steps To Reproduce:

  • Create a protected attribute marked method
  • Run the ide-helper:models command
@viicslen viicslen added the bug label Jan 5, 2022
@viicslen
Copy link
Author

viicslen commented Jan 5, 2022

While tinkering a bit with how Laravel handles these methods I found that we can get all methods even non-public by using (new ReflectionClass($instance))->getMethods() instead of get_class_methods()

@pindab0ter
Copy link
Contributor

I would love to see this improvement made to be able to adhere to the recommended code style.

@mridul89
Copy link

mridul89 commented Apr 7, 2022

I created PR for this around a month ago- #1325

@mfn
Copy link
Collaborator

mfn commented Apr 7, 2022

@mridul89 seems I've forgotten about it; my first reaction: 0 tests. Probably that's the reason I wanted to queue it for later and then forgot about it…

@mridul89
Copy link

mridul89 commented Apr 7, 2022

@mfn Sorry about that, i thought the existing tests would be fine since this is a bugfix.

I pushed another commit on the PR #1325 now.

@pindab0ter
Copy link
Contributor

pindab0ter commented Apr 7, 2022

In general, if you add a feature or fix a bug, you write tests for it to prove that it works since the existing tests won't point that out.

It's also a good idea to mention the issue you're fixing in the description of the PR. Since this issue wasn't mentioned in your PR I didn't see it and therefore didn't know it existed.

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

No branches or pull requests

4 participants