Skip to content

remove getDoctrine*() methods from PhpDocInfo, use getByType() instead#1935

Merged
TomasVotruba merged 1 commit intomasterfrom
specific-to-get-type
Aug 31, 2019
Merged

remove getDoctrine*() methods from PhpDocInfo, use getByType() instead#1935
TomasVotruba merged 1 commit intomasterfrom
specific-to-get-type

Conversation

@TomasVotruba
Copy link
Copy Markdown
Member

No description provided.

@TomasVotruba TomasVotruba merged commit 4379b4a into master Aug 31, 2019
@TomasVotruba TomasVotruba deleted the specific-to-get-type branch August 31, 2019 12:00
Comment thread .phpstorm.meta.php
override(\Psr\Container\ContainerInterface::get(0), type(0));

// $propertyPhpDocInfo->getByType(Type::class) → instance of "Type"|null - @todo how to make this nullable?
override(\Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo::getByType(0), type(0));
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@nikic Do you have any tip how to teach PHPStorm nullable type?

I tried variations of ↓... but no success

-type(0)
+type(0)|null

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unfortunately this isn't supported right now. PhpStorm itself doesn't do much in terms of nullability analysis, so the missing null type probably won't result in false positive warnings at least.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I see, feature then, thank you 👍

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

TomasVotruba added a commit that referenced this pull request Mar 15, 2022
rectorphp/rector-src@7202782 [CodeQuality] Add InlineConstructorDefaultToPropertyRector (#1935)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants