Skip to content

Resolve encapsed values as strings#4622

Merged
TomasVotruba merged 1 commit intorectorphp:mainfrom
Bellardia:patch-1
Aug 6, 2023
Merged

Resolve encapsed values as strings#4622
TomasVotruba merged 1 commit intorectorphp:mainfrom
Bellardia:patch-1

Conversation

@Bellardia
Copy link
Copy Markdown
Contributor

As far as I'm aware an Encapsed will always result in a string

@Bellardia Bellardia requested a review from TomasVotruba as a code owner July 30, 2023 15:36
@staabm
Copy link
Copy Markdown
Contributor

staabm commented Jul 30, 2023

Could you add a testcase which fails without your change?

Copy link
Copy Markdown
Member

@samsonasik samsonasik left a comment

Choose a reason for hiding this comment

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

I can see instanceof Encapsed marked as StringType in AlwaysStrictScalarExprAnalyzer already:

if ($scalar instanceof Encapsed) {
return new StringType();
}

so I think it is fine 👍

@TomasVotruba
Copy link
Copy Markdown
Member

Thank you 👍

@TomasVotruba TomasVotruba merged commit 395b215 into rectorphp:main Aug 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants