Skip to content

Allow to increment strings#200

Merged
ondrejmirtes merged 3 commits into
phpstan:1.5.xfrom
VincentLanglet:stringIncrement
Feb 6, 2023
Merged

Allow to increment strings#200
ondrejmirtes merged 3 commits into
phpstan:1.5.xfrom
VincentLanglet:stringIncrement

Conversation

@VincentLanglet
Copy link
Copy Markdown
Contributor

@VincentLanglet VincentLanglet commented Jan 18, 2023

Closes #174

1.5.x seemed to be the default branch but I can also open the PR on 1.4.x

return true;
}

if ($type instanceof StringType) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
if ($type instanceof StringType) {
if ($type->isString()->yes()) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, changed

Comment thread tests/Rules/Operators/OperandInArithmeticPostDecrementRuleTest.php
Comment thread tests/Rules/Operators/OperandInArithmeticPreDecrementRuleTest.php
@VincentLanglet VincentLanglet requested review from ondrejmirtes and staabm and removed request for ondrejmirtes and staabm January 19, 2023 11:51
@ondrejmirtes ondrejmirtes merged commit 66b378f into phpstan:1.5.x Feb 6, 2023
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you.

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.

FP: string++ | "Only numeric types are allowed in post-increment, string given."

3 participants