Skip to content

Conversation

@TomasVotruba
Copy link
Member

No description provided.

return false;
}

return ! $this->phpVersionProvider->isAtLeastPhpVersion(PhpVersion::PHP_80);
Copy link
Member

Choose a reason for hiding this comment

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

PHPStan already detect it clearly when run on php 7.x

see https://phpstan.org/r/853f59a6-22ad-48ac-af93-66606b569613

on PHP 7.2 - 7.4 tab.

Copy link
Member Author

Choose a reason for hiding this comment

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

But not on PHP 8.0+. This also allow to add our test with PHP 7.4 version.

*/
$subClassName = (string) substr(

$subClassName = substr(
Copy link
Member

Choose a reason for hiding this comment

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

this cast is needed here as downgrade rule is not yet created.

Copy link
Member Author

Choose a reason for hiding this comment

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

This should be fixed with incorrect input instead. This structure is clearly wrong.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, I will create separate PR target your branch for different logic to handle this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Great 👍 We'll need to understand what values are going in any why it returns false.
It should be fixed to return always string instead

Copy link
Member

Choose a reason for hiding this comment

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

see #7450

@TomasVotruba TomasVotruba merged commit 9a95b6b into main Oct 8, 2025
50 checks passed
@TomasVotruba TomasVotruba deleted the tv-string-cast branch October 8, 2025 07:20
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.

4 participants