Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[PropertyInfo] Get short description from promoted properties inPhpDocExtractor
#59540
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:7.4
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This is a feature and should target 7.3 |
wuchen90 commentedJan 17, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I don't know if this is really a feature because it works well with Beside, this code below points out that we support promoted properties:
|
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.
Can you update the changelog as well, as it's a feature?
Uh oh!
There was an error while loading.Please reload this page.
$paramDescription = $param->getDescription()?->render(); | ||
if (null !== $paramDescription && '' !== $paramDescription) { |
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.
if (null !==$paramDescription &&'' !==$paramDescription) { | |
if ($paramDescription) { |
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.
Are you sure?
<?php$paramDescription ='0';echo$paramDescription ?'ok' :'ko';// 'ko'echonull !==$paramDescription &&'' !==$paramDescription ?'ok' :'ko';// 'ok'
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.
not sure0
a useful description either
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.
Trimming0
won't make it less predictable?
I mean in the way that, from the user point of view, we naturally expect that empty string or null can be skipped.
But other than these two cases, shouldn't we return what the user has input or is it what Symfony used to do for this kind of code?
If we skip0
then I should add a test for it.
Looking at your code change this seems like it wasn't implemented before, there is no wrong behavior, the feature is just not existent, so a feature to me. |
I think the implementation would now read |
8a99cd3
tof6c61c1
CompareThere 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.
Target branch changed to 7.3.
Uh oh!
There was an error while loading.Please reload this page.
$paramDescription = $param->getDescription()?->render(); | ||
if (null !== $paramDescription && '' !== $paramDescription) { |
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.
Are you sure?
<?php$paramDescription ='0';echo$paramDescription ?'ok' :'ko';// 'ko'echonull !==$paramDescription &&'' !==$paramDescription ?'ok' :'ko';// 'ok'
Indeed, forgot about it, you can keep |
src/Symfony/Component/PropertyInfo/Tests/Fixtures/Extractor/PromotedPropertiesWithDocBlock.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
$paramDescription = $param->getDescription()?->render(); | ||
if (null !== $paramDescription && '' !== $paramDescription) { |
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.
not sure0
a useful description either
f6c61c1
to9141b68
ComparePhpDocExtractor
Uh oh!
There was an error while loading.Please reload this page.
Currently this kind of phpdoc doesn't work to get description:
Whereas this one works: