Add failing test fixture for NullToStrictStringFuncCallArgRector#3012
Closed
stephanvierkant wants to merge 1 commit intorectorphp:mainfrom
Closed
Add failing test fixture for NullToStrictStringFuncCallArgRector#3012stephanvierkant wants to merge 1 commit intorectorphp:mainfrom
stephanvierkant wants to merge 1 commit intorectorphp:mainfrom
Conversation
# Failing Test for NullToStrictStringFuncCallArgRector Based on https://getrector.org/demo/9a90408b-44b7-48f9-a5fa-458a526e8749
Member
|
That's expected, property is defined in class, while trait access it, it will be marked as mixed, as trait here is depends on class. Once the trait is consumed by class that not has the property, it will be undefined https://3v4l.org/Yt7Bq . Even property defined in trait, accessing property from property fetch under trait seems not possible, at least for now. |
Contributor
Author
|
Thanks for your reply. I experienced this problem after PHPStan notifying me that there is a useless type cast. So there should be a way to detect that $title is a |
Member
|
These 2 files should be separated. One in Fixture and another in Source. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Failing Test for NullToStrictStringFuncCallArgRector
Based on https://getrector.org/demo/9a90408b-44b7-48f9-a5fa-458a526e8749
Code should be untouched:
trimcan't get anullvalue. If method is used without trait, it works fine.