Skip to content

[PropertyInfo] Make PhpDocExtractor::getDocBlock() public #52632

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

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

Nyholm
Copy link
Member

@Nyholm Nyholm commented Nov 17, 2023

Q A
Branch? 7.1
Bug fix? no
New feature? yes
Deprecations? no
Issues N/a
License MIT

Im parsing properties and I would love to find out what is in the doc block for a property.
Help me figure out why it would be a bad idea to make this method public.

@stof
Copy link
Member

stof commented Nov 17, 2023

As this method does returns a shape with 3 info and not just the docblock, I would not make it public. I don't think we want to provide BC for the current API.

@Nyholm
Copy link
Member Author

Nyholm commented Nov 17, 2023

Good point.
I suggest to create a new public method then with a simpler API. What do you think about that?

@ro0NL
Copy link
Contributor

ro0NL commented Nov 17, 2023

Help me figure out why it would be a bad idea to make this method public.

I think because it's not a component responsibility, as per current contracts.

@Nyholm
Copy link
Member Author

Nyholm commented Nov 17, 2023

Hm.. Im not sure I agree with that. You could expect the "property info" component to be able to extract the Doc Block of a property.

Or maybe I misunderstand you. Are you suggesting I should introduce a proper interface for this method?

@ro0NL
Copy link
Contributor

ro0NL commented Nov 17, 2023

Shouldn't you be using https://github.com/phpDocumentor/ReflectionDocBlock instead?

@ro0NL
Copy link
Contributor

ro0NL commented Nov 17, 2023

You could expect the "property info" component to be able to extract the Doc Block of a property

Yes, but there's no real contract for it currently

@Nyholm
Copy link
Member Author

Nyholm commented Nov 18, 2023

Shouldn't you be using https://github.com/phpDocumentor/ReflectionDocBlock instead?

I looked into that. But I do like the feature from PropertyInfo component that would find where the docblock is. Ie, if the property is not documented it goes to the mutator.

I'll make sure to prepare a proper contract and prepare this PR.

@Nyholm
Copy link
Member Author

Nyholm commented Nov 19, 2023

I've updated the PR with a proper interface and a good return value.

@Nyholm
Copy link
Member Author

Nyholm commented Nov 23, 2023

Thank you for the reviews. I've updated according to the suggestions.

@OskarStark OskarStark changed the title Make PhpDocExtractor::getDocBlock() public Make PhpDocExtractor::getDocBlock() public Nov 24, 2023
@carsonbot carsonbot changed the title Make PhpDocExtractor::getDocBlock() public [PropertyInfo] Make PhpDocExtractor::getDocBlock() public Nov 24, 2023
Copy link
Contributor

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments

@fabpot
Copy link
Member

fabpot commented Dec 4, 2023

Thank you @Nyholm.

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

Successfully merging this pull request may close these issues.

8 participants