Fix #7692, Add fixture for TypedPropertyFromAssignsRector#3244
Closed
puniserv wants to merge 1 commit intorectorphp:mainfrom
Closed
Fix #7692, Add fixture for TypedPropertyFromAssignsRector#3244puniserv wants to merge 1 commit intorectorphp:mainfrom
puniserv wants to merge 1 commit intorectorphp:mainfrom
Conversation
Member
|
It seems you need to move the fixture under to demonstrate invalid usage on php8+ feature |
Member
|
Various notes:
+ private ?\DateTime&\PHPUnit\Framework\MockObject\MockObject $property = null;Ref https://getrector.org/demo/9639d6c3-b5a5-47ef-8565-f3037cde9e64 nullable can't be combined with intersection directly, see: https://3v4l.org/QQi2E#v8.2.0 (nullable ?) so it should be : + private null|(\DateTime&\PHPUnit\Framework\MockObject\MockObject) $property = null; |
Member
|
Based on above notes, it seems the solution is skip on php 7.4 and 8.0 for that, and apply changes on php 8.1+ with intersection types enabled: - /**
- * @var DateTime&MockObject
- */
+ private null|(\DateTime&\PHPUnit\Framework\MockObject\MockObject) $property = null;like @VincentLanglet comment at rectorphp/rector#7692 (comment) |
Member
|
Actually, without the |
samsonasik
added a commit
that referenced
this pull request
Feb 12, 2023
Member
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.
No description provided.