Skip to content

Commit ec0c6c2

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: [Mailer] [Amazon] Ensure "ext-simplexml" is loaded if SesApiTransport is used Stop using deprecated trait [PhpUnitBridge] Lint files with PHP 5.5
2 parents 2d7cac6 + bb5b5ce commit ec0c6c2

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

ClassExistsMock.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,23 @@ public static function withMockedClasses(array $classes)
3030

3131
public static function class_exists($name, $autoload = true)
3232
{
33-
return (bool) (self::$classes[ltrim($name, '\\')] ?? \class_exists($name, $autoload));
33+
$name = ltrim($name, '\\');
34+
35+
return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \class_exists($name, $autoload);
3436
}
3537

3638
public static function interface_exists($name, $autoload = true)
3739
{
38-
return (bool) (self::$classes[ltrim($name, '\\')] ?? \interface_exists($name, $autoload));
40+
$name = ltrim($name, '\\');
41+
42+
return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \interface_exists($name, $autoload);
3943
}
4044

4145
public static function trait_exists($name, $autoload = true)
4246
{
43-
return (bool) (self::$classes[ltrim($name, '\\')] ?? \trait_exists($name, $autoload));
47+
$name = ltrim($name, '\\');
48+
49+
return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \trait_exists($name, $autoload);
4450
}
4551

4652
public static function register($class)

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\SymfonyTestsListenerForV5;
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)