Skip to content

[Php81] Skip array dim fetch args in NullToStrictStringFuncCallArgRector#8164

Merged
TomasVotruba merged 1 commit into
mainfrom
remove-null-strict-string-from-level
Jul 10, 2026
Merged

[Php81] Skip array dim fetch args in NullToStrictStringFuncCallArgRector#8164
TomasVotruba merged 1 commit into
mainfrom
remove-null-strict-string-from-level

Conversation

@TomasVotruba

@TomasVotruba TomasVotruba commented Jul 10, 2026

Copy link
Copy Markdown
Member

NullToStrictStringFuncCallArgRector now skips array dim fetch args ($array['key']).

Array dim fetch values are mixed — the null is not known, so casting to (string) may be wrong. Now explicitly skipped:

 public function run(array $data)
 {
-    return str_replace('a', 'b', (string) $data['key']);
+    return str_replace('a', 'b', $data['key']);
 }

@TomasVotruba
TomasVotruba force-pushed the remove-null-strict-string-from-level branch from d4eb82d to 5b19bd2 Compare July 10, 2026 09:31
@TomasVotruba TomasVotruba changed the title [Php81] Remove NullToStrictStringFuncCallArgRector from level set, skip array dim fetch args [Php81] Skip array dim fetch args in NullToStrictStringFuncCallArgRector Jul 10, 2026
@TomasVotruba
TomasVotruba merged commit 3d89807 into main Jul 10, 2026
65 checks passed
@TomasVotruba
TomasVotruba deleted the remove-null-strict-string-from-level branch July 10, 2026 09:40
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.

1 participant