Skip to content

Conversation

@TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Dec 4, 2025

Temporary workaround to allow printer work on named args of array_map()

Follow up to #7676

Closes rectorphp/rector#9492

@TomasVotruba TomasVotruba force-pushed the tv-sort-args-fix-1 branch 3 times, most recently from 4438b12 to ef3aa32 Compare December 4, 2025 21:17
@TomasVotruba TomasVotruba force-pushed the tv-sort-args-fix-1 branch 2 times, most recently from d8d7732 to 6b94299 Compare December 4, 2025 22:02
Copy link
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.

To support cross-platform compatibility( eg on windows) it can be changed to:

// Normalize line endings for cross-platform compatibility
$this->assertSame(
    str_replace("\r\n", "\n", $expectedContents),
    str_replace("\r\n", "\n", $printerContents)
);

in PHPStanPrinterTest.php

I can help fix it if you need :)

@TomasVotruba TomasVotruba merged commit 539b3fe into main Dec 4, 2025
57 checks passed
@TomasVotruba TomasVotruba deleted the tv-sort-args-fix-1 branch December 4, 2025 22:22
@samsonasik
Copy link
Member

@TomasVotruba phpstan 2.1.33 just released https://github.com/phpstan/phpstan/releases/tag/2.1.33

I think we can give phpstan 2.1.33 a try, include the ArrayMapArgVisitor so type casting will not be needed under array of strings change https://github.com/rectorphp/rector-src/pull/7715/files#diff-a848e3edfbb5abb06db37b312a6689b7f9e73d2438a141166c1ebf43613ff8d2

@samsonasik
Copy link
Member

I created PR:

for it 👍

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.

Sort named arguments breaks file

3 participants