Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7800a2a

Browse filesBrowse files
committed
feature #36426 [Form] Deprecated unused old ServerParams util (HeahDude)
This PR was merged into the 5.1-dev branch. Discussion ---------- [Form] Deprecated unused old `ServerParams` util | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | Deprecations? | yes | Tickets | ~ | License | MIT | Doc PR | ~ A left over after #11924 (comment), this class is unused since Symfony 2.3 ^^'. I've noticed it before but never took the time to submit a PR because this is very minor IMHO. But since this deprecation should not impact anyone, let's keep the codebase clean and remove it in 6.0. Commits ------- e05e924 [Form] Deprecated unused old `ServerParams` util
2 parents cea5ebc + e05e924 commit 7800a2a
Copy full SHA for 7800a2a

File tree

Expand file treeCollapse file tree

6 files changed

+40
-2
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+40
-2
lines changed

‎UPGRADE-5.1.md

Copy file name to clipboardExpand all lines: UPGRADE-5.1.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Form
4444
* Implementing the `FormConfigBuilderInterface` without implementing the `setIsEmptyCallback()` method
4545
is deprecated. The method will be added to the interface in 6.0.
4646
* Added argument `callable|null $filter` to `ChoiceListFactoryInterface::createListFromChoices()` and `createListFromLoader()` - not defining them is deprecated.
47+
* Using `Symfony\Component\Form\Extension\Validator\Util\ServerParams` class is deprecated, use its parent `Symfony\Component\Form\Util\ServerParams` instead.
4748

4849
FrameworkBundle
4950
---------------

‎UPGRADE-6.0.md

Copy file name to clipboardExpand all lines: UPGRADE-6.0.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Form
4242
* Added the `getIsEmptyCallback()` method to the `FormConfigInterface`.
4343
* Added the `setIsEmptyCallback()` method to the `FormConfigBuilderInterface`.
4444
* Added argument `callable|null $filter` to `ChoiceListFactoryInterface::createListFromChoices()` and `createListFromLoader()`.
45+
* The `Symfony\Component\Form\Extension\Validator\Util\ServerParams` class has been removed, use its parent `Symfony\Component\Form\Util\ServerParams` instead.
4546

4647
FrameworkBundle
4748
---------------

‎src/Symfony/Component/Form/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ CHANGELOG
1616
* Implementing the `FormConfigBuilderInterface` without implementing the `setIsEmptyCallback()` method
1717
is deprecated. The method will be added to the interface in 6.0.
1818
* Added a `rounding_mode` option for the PercentType and correctly round the value when submitted
19+
* Deprecated `Symfony\Component\Form\Extension\Validator\Util\ServerParams` in favor of its parent class `Symfony\Component\Form\Util\ServerParams`
1920

2021
5.0.0
2122
-----

‎src/Symfony/Component/Form/Extension/Validator/Util/ServerParams.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Validator/Util/ServerParams.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@
1313

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

16+
trigger_deprecation('symfony/form', '5.1', 'The "%s" class is deprecated. Use "%s" instead.', ServerParams::class, BaseServerParams::class);
17+
1618
/**
1719
* @author Bernhard Schussek <bschussek@gmail.com>
20+
*
21+
* @deprecated since Symfony 5.1. Use {@see BaseServerParams} instead.
1822
*/
1923
class ServerParams extends BaseServerParams
2024
{
+31Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Form\Tests\Extension\Validator\Util;
13+
14+
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
16+
use Symfony\Component\Form\Extension\Validator\Util\ServerParams;
17+
18+
class LegacyServerParamsTest extends TestCase
19+
{
20+
use ExpectDeprecationTrait;
21+
22+
/**
23+
* @group legacy
24+
*/
25+
public function testClassIsDeprecated()
26+
{
27+
$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.');
28+
29+
new ServerParams();
30+
}
31+
}

‎src/Symfony/Component/Form/Tests/Extension/Validator/Util/ServerParamsTest.php renamed to ‎src/Symfony/Component/Form/Tests/Util/ServerParamsTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Util/ServerParamsTest.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\Form\Tests\Extension\Validator\Util;
12+
namespace Symfony\Component\Form\Tests\Util;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Component\Form\Extension\Validator\Util\ServerParams;
15+
use Symfony\Component\Form\Util\ServerParams;
1616
use Symfony\Component\HttpFoundation\Request;
1717
use Symfony\Component\HttpFoundation\RequestStack;
1818

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.