-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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
Conversation
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. |
Good point. |
I think because it's not a component responsibility, as per current contracts. |
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? |
Shouldn't you be using https://github.com/phpDocumentor/ReflectionDocBlock instead? |
Yes, but there's no real contract for it currently |
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. |
I've updated the PR with a proper interface and a good return value. |
src/Symfony/Component/PropertyInfo/PropertyDocBlockExtractorInterface.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/PropertyInfo/PropertyDocBlockExtractorInterface.php
Outdated
Show resolved
Hide resolved
Thank you for the reviews. I've updated according to the suggestions. |
PhpDocExtractor::getDocBlock()
public
PhpDocExtractor::getDocBlock()
publicPhpDocExtractor::getDocBlock()
public
src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/PropertyInfo/PropertyDocBlockExtractorInterface.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments
e54cb6b
to
95f8c1d
Compare
Thank you @Nyholm. |
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.