Skip to content

[code-quality] Add ParameterBagTypedGetMethodCallRector#834

Merged
TomasVotruba merged 4 commits intomainfrom
tv-cleanup
Sep 1, 2025
Merged

[code-quality] Add ParameterBagTypedGetMethodCallRector#834
TomasVotruba merged 4 commits intomainfrom
tv-cleanup

Conversation

@TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Sep 1, 2025

Ref symfony/symfony#48525

use Symfony\Component\HttpFoundation\Request;

final class GetOnBoolean
{
    public function run(Request $request)
    {
-        $debug = (bool) $request->query->get('debug', false);
+        $debug = $request->query->getBoolean('debug');
    }
}

@TomasVotruba TomasVotruba changed the title tv cleanup [code-quality] Add ParameterBagTypedGetMethodCallRector Sep 1, 2025
@TomasVotruba TomasVotruba force-pushed the tv-cleanup branch 3 times, most recently from 617b1f9 to 4b584f7 Compare September 1, 2025 10:00
@TomasVotruba TomasVotruba enabled auto-merge (squash) September 1, 2025 10:04
@TomasVotruba TomasVotruba merged commit 108091b into main Sep 1, 2025
5 checks passed
@TomasVotruba TomasVotruba deleted the tv-cleanup branch September 1, 2025 10:05
}

private function refactorMethodCall(MethodCall $methodCall): ?MethodCall
{
Copy link
Member

Choose a reason for hiding this comment

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

first class callable need to be skipped early

Copy link
Member

Choose a reason for hiding this comment

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

@@ -1,18 +0,0 @@
<?php
Copy link
Member

Choose a reason for hiding this comment

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

@TomasVotruba this removal seems cause eror on rector-phpunit rector run:

https://github.com/rectorphp/rector-phpunit/actions/runs/17376070939/job/49322564263?pr=527#step:5:13

 [ERROR] Class "Rector\Symfony\Set\FOSRestSetList" not found                    

Copy link
Member

Choose a reason for hiding this comment

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

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