8000 [Form] Deprecated unused old `ServerParams` util by HeahDude · Pull Request #36426 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] Deprecated unused old ServerParams util #36426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Form] Deprecated unused old ServerParams util
  • Loading branch information
HeahDude committed Apr 12, 2020
commit e05e924c5a8ce98a9a156e7ca8dc3cfae6253e08
1 change: 1 addition & 0 deletions UPGRADE-5.1.md
< 8000 input type="hidden" name="path" value="UPGRADE-5.1.md" autocomplete="off" data-targets="deferred-diff-lines.inputs" />
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Form
* Implementing the `FormConfigBuilderInterface` without implementing the `setIsEmptyCallback()` method
is deprecated. The method will be added to the interface in 6.0.
* Added argument `callable|null $filter` to `ChoiceListFactoryInterface::createListFromChoices()` and `createListFromLoader()` - not defining them is deprecated.
* Using `Symfony\Component\Form\Extension\Validator\Util\ServerParams` class is deprecated, use its parent `Symfony\Component\Form\Util\ServerParams` instead.

FrameworkBundle
---------------
Expand Down
1 change: 1 addition & 0 deletions UPGRADE-6.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Form
* Added the `getIsEmptyCallback()` method to the `FormConfigInterface`.
* Added the `setIsEmptyCallback()` method to the `FormConfigBuilderInterface`.
* Added argument `callable|null $filter` to `ChoiceListFactoryInterface::createListFromChoices()` and `createListFromLoader()`.
* The `Symfony\Component\Form\Extension\Validator\Util\ServerParams` class has been removed, use its parent `Symfony\Component\Form\Util\ServerParams` instead.

FrameworkBundle
---------------
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Form/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ CHANGELOG
* Implementing the `FormConfigBuilderInterface` without implementing the `setIsEmptyCallback()` method
is deprecated. The method will be added to the interface in 6.0.
* Added a `rounding_mode` option for the PercentType and correctly round the value when submitted
* Deprecated `Symfony\Component\Form\Extension\Validator\Util\ServerParams` in favor of its parent class `Symfony\Component\Form\Util\ServerParams`

5.0.0
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@

use Symfony\Component\Form\Util\ServerParams as BaseServerParams;

trigger_deprecation('symfony/form', '5.1', 'The "%s" class is deprecated. Use "%s" instead.', ServerParams::class, BaseServerParams::class);

/**
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @deprecated since Symfony 5.1. Use {@see BaseServerParams} instead.
*/
class ServerParams extends BaseServerParams
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\Form\Tests\Extension\Validator\Util;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
use Symfony\Component\Form\Extension\Validator\Util\ServerParams;

class LegacyServerParamsTest extends TestCase
{
use ExpectDeprecationTrait;

/**
* @group legacy
*/
public function testClassIsDeprecated()
{
$this->expectDeprecation('Since symfony/form 5.1: The "Symfony\Component\Form\Extension\Validator\Util\ServerParams" class is deprecated. Use "Symfony\Component\Form\Util\ServerParams" instead.');

new ServerParams();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
* file that was distributed with this source code.
*/

namespace Symfony\Component\Form\Tests\Extension\Validator\Util;
namespace Symfony\Component\Form\Tests\Util;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Form\Extension\Validator\Util\ServerParams;
use Symfony\Component\Form\Util\ServerParams;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;

Expand Down
0