Skip to content

Commit 73f7929

Browse files
committed
Deprecate trait
1 parent 65bea85 commit 73f7929

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

UPGRADE-5.3.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ HttpKernel
1818

1919
* Marked the class `Symfony\Component\HttpKernel\EventListener\DebugHandlersListener` as internal
2020

21+
PhpunitBridge
22+
-------------
23+
24+
* Deprecated the `SetUpTearDownTrait` trait, use original methods with "void" return typehint.
25+
2126
Security
2227
--------
2328

UPGRADE-6.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ PhpUnitBridge
129129
-------------
130130

131131
* Removed support for `@expectedDeprecation` annotations, use the `ExpectDeprecationTrait::expectDeprecation()` method instead.
132+
* Removed the `SetUpTearDownTrait` trait, use original methods with "void" return typehint.
132133

133134
PropertyAccess
134135
--------------

src/Symfony/Bridge/PhpUnit/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ CHANGELOG
66

77
* bumped the minimum PHP version to 7.1.3
88
* bumped the minimum PHPUnit version to 7.5
9+
* deprecated the `SetUpTearDownTrait` trait, use original methods with "void" return typehint.
910

1011
5.1.0
1112
-----

src/Symfony/Bridge/PhpUnit/SetUpTearDownTrait.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515

16+
trigger_deprecation('symfony/phpunit-bridge', '5.3', 'The "%s" trait is deprecated, use original methods with "void" return typehint.', SetUpTearDownTrait::class);
17+
1618
// A trait to provide forward compatibility with newest PHPUnit versions
1719
$r = new \ReflectionClass(TestCase::class);
1820
if (!$r->getMethod('setUp')->hasReturnType()) {

src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/DeprecationTest.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@
1515
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler;
1616
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler\Deprecation;
1717
use Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerForV7;
18-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
1918

2019
class DeprecationTest extends TestCase
2120
{
22-
use SetUpTearDownTrait;
23-
2421
private static $vendorDir;
2522
private static $prefixDirsPsr4;
2623

@@ -261,7 +258,7 @@ private static function removeDir($dir)
261258
rmdir($dir);
262259
}
263260

264-
private static function doSetupBeforeClass()
261+
public static function setupBeforeClass(): void
265262
{
266263
foreach (get_declared_classes() as $class) {
267264
if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) {
@@ -281,7 +278,7 @@ private static function doSetupBeforeClass()
281278
}
282279
}
283280

284-
private static function doTearDownAfterClass()
281+
public static function tearDownAfterClass(): void
285282
{
286283
foreach (self::$prefixDirsPsr4 as [$prop, $loader, $prefixDirsPsr4]) {
287284
$prop->setValue($loader, $prefixDirsPsr4);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy