Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make NullToStrictStringFuncCallArgRector run without scope #4792

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Aug 14, 2023

Ref #4730

@TomasVotruba TomasVotruba force-pushed the tv-avoid-scope-if-possible-2 branch from 8d8de86 to 1bf92d4 Compare August 14, 2023 14:29
@TomasVotruba TomasVotruba force-pushed the tv-avoid-scope-if-possible-2 branch from 1bf92d4 to bdf13cb Compare August 14, 2023 14:29
@TomasVotruba TomasVotruba merged commit 514df0a into main Aug 14, 2023
@TomasVotruba TomasVotruba deleted the tv-avoid-scope-if-possible-2 branch August 14, 2023 14:31
&$string
): string {
$innerPattern = $match['content'];
$positionDelimiter = strpos((string) $innerPattern, '');
Copy link
Member

Choose a reason for hiding this comment

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

most ArrayDimFetch without context will go ErrorType, this should be skipped as before

@@ -477,10 +474,6 @@ private function processNullToStrictStringOnNodePosition(
return null;
}

if ($this->isAnErrorTypeFromParentScope($argValue, $scope)) {
Copy link
Member

Choose a reason for hiding this comment

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

this should be reverted, most ArrayDimFetch without context will go ErrorType, and it wil cause huge string cast in legacy code


use Nette\Utils\Strings;

final class SkipErrorType
Copy link
Member

Choose a reason for hiding this comment

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

This fixture removal need to be reverted, per my comment before, ArrayDimFetch without context got ErrorType, it will make the rule unusable as it change the valid type string already, which mostly correct on regex check usage

@samsonasik
Copy link
Member

@TomasVotruba I am reverting at #4793

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.

2 participants