Symfony42: Remove invalid rectors#1627
Conversation
Ref: symfony/symfony@f75fffa These deprecation warnings are for when inherited class calls parent method.
|
I don't understand. The commit link is confusing. |
|
These deprecations warnings for for classes extending the symfony ones. for example. This will trigger a deprecation warning. <?php
class ClassThatInheritClient extends Client
{
public function submit(DomCrawlerForm $form, array $values []))
{
return parent::submit($form, $values);
}
}It should be fixed to: <?php
class ClassThatInheritClient extends Client
{
public function submit(DomCrawlerForm $form, array $values [], array $serverParameters = [])))
{
return parent::submit($form, $values, $serverParameters);
}
}The current rectors are incorrrectly changing calls to the current symfony methods, i.e. <?php
class MyService
{
public function __invoke()
{
$client = new \Symfony\Component\HttpKernel\Client(...);
$client->submit($form);
}
}to this <?php
class MyService
{
public function __invoke()
{
$client = new \Symfony\Component\HttpKernel\Client(...);
$client->submit($form, []);
}
} |
|
I see. In that way it should not be removed but fixed. There should be new configuration option, that adds it only to parent call + class method. services:
Rector\Rector\Argument\ArgumentAdderRector:
Symfony\Component\BrowserKit\Client:
submit:
2:
name: 'serverParameters'
default_value: []
+ type: ['class_method', 'parent_call'] |
|
👍 so it's not possible right now? |
|
Not yet |
|
Right. So shall we merge this for now? As this config is causing incorrect changes |
|
No, it needs to be fixed so it works as it should. |
|
up to you, but at the moment keeping this causes an incorrect migration, which is better than no migration. |
|
I know. But finished work is better than double work. |
Ref: symfony/symfony@f75fffa
These deprecation warnings are for when inherited class calls parent method.