Skip to content

[Symfony42] Make default values more specific per node #1662

@TomasVotruba

Description

@TomasVotruba

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.
Changing this:

<?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, []);
    }
}

Originally posted by @bendavies in #1627 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions