8000 feature #36426 [Form] Deprecated unused old `ServerParams` util (Heah… · symfony/form@bf4b3a8 · GitHub
[go: up one dir, main page]

Skip to content

Commit bf4b3a8

Browse 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 symfony/symfony#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 ------- e05e924c5a [Form] Deprecated unused old `ServerParams` util
2 parents d8c7e12 + 5d2e299 commit bf4b3a8

File tree

4 files changed

+38
-2
lines changed
  • Tests
  • 4 files changed

    +38
    -2
    lines changed

    CHANGELOG.md

    Lines 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
    -----

    Extension/Validator/Util/ServerParams.php

    Lines 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
    {
    Lines 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+
    }

    Tests/Extension/Validator/Util/ServerParamsTest.php renamed to Tests/Util/ServerParamsTest.php

    Lines 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