Skip to content

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

Open

Description

@viicslen

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

Activity

  1. viicslen commented on Jan 5, 2022

    @viicslen
    Author

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

  2. pindab0ter commented on Feb 10, 2022

    @pindab0ter
    Contributor

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

  3. mridul89 commented on Apr 7, 2022

    @mridul89

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

  4. mfn commented on Apr 7, 2022

    @mfn
    Collaborator

    @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…

  5. mridul89 commented on Apr 7, 2022

    @mridul89

    @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.

  6. pindab0ter commented on Apr 7, 2022

    @pindab0ter
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions