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 e05e924

Browse filesBrowse files
committed
[Form] Deprecated unused old ServerParams util
1 parent 2059db2 commit e05e924
Copy full SHA for e05e924

File tree

6 files changed

+40
-2
lines changed
Filter options

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
@@ -43,6 +43,7 @@ Form
4343
* Implementing the `FormConfigBuilderInterface` without implementing the `setIsEmptyCallback()` method
4444
is deprecated. The method will be added to the interface in 6.0.
4545
* Added argument `callable|null $filter` to `ChoiceListFactoryInterface::createListFromChoices()` and `createListFromLoader()` - not defining them is deprecated.
46+
* Using `Symfony\Component\Form\Extension\Validator\Util\ServerParams` class is deprecated, use its parent `Symfony\Component\Form\Util\ServerParams` instead.
4647

4748
FrameworkBundle
4849
---------------

‎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
@@ -41,6 +41,7 @@ Form
4141
* Added the `getIsEmptyCallback()` method to the `FormConfigInterface`.
4242
* Added the `setIsEmptyCallback()` method to the `FormConfigBuilderInterface`.
4343
* Added argument `callable|null $filter` to `ChoiceListFactoryInterface::createListFromChoices()` and `createListFromLoader()`.
44+
* The `Symfony\Component\Form\Extension\Validator\Util\ServerParams` class has been removed, use its parent `Symfony\Component\Form\Util\ServerParams` instead.
4445

4546
FrameworkBundle
4647
---------------

‎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.