Skip to content

Commit

Permalink
Merge branch '4.4' into 5.1
Browse files Browse the repository at this point in the history
* 4.4:
  [Mailer] [Amazon] Ensure "ext-simplexml" is loaded if SesApiTransport is used
  Stop using deprecated trait
  [PhpUnitBridge] Lint files with PHP 5.5
  • Loading branch information
jderusse committed Dec 14, 2020
2 parents 2d7cac6 + bb5b5ce commit ec0c6c2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
12 changes: 9 additions & 3 deletions ClassExistsMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,23 @@ public static function withMockedClasses(array $classes)

public static function class_exists($name, $autoload = true)
{
return (bool) (self::$classes[ltrim($name, '\\')] ?? \class_exists($name, $autoload));
$name = ltrim($name, '\\');

return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \class_exists($name, $autoload);
}

public static function interface_exists($name, $autoload = true)
{
return (bool) (self::$classes[ltrim($name, '\\')] ?? \interface_exists($name, $autoload));
$name = ltrim($name, '\\');

return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \interface_exists($name, $autoload);
}

public static function trait_exists($name, $autoload = true)
{
return (bool) (self::$classes[ltrim($name, '\\')] ?? \trait_exists($name, $autoload));
$name = ltrim($name, '\\');

return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \trait_exists($name, $autoload);
}

public static function register($class)
Expand Down
7 changes: 2 additions & 5 deletions Tests/DeprecationErrorHandler/DeprecationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler;
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler\Deprecation;
use Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerForV5;
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;

class DeprecationTest extends TestCase
{
use SetUpTearDownTrait;

private static $vendorDir;
private static $prefixDirsPsr4;

Expand Down Expand Up @@ -261,7 +258,7 @@ private static function removeDir($dir)
rmdir($dir);
}

private static function doSetupBeforeClass()
public static function setupBeforeClass(): void
{
foreach (get_declared_classes() as $class) {
if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) {
Expand All @@ -281,7 +278,7 @@ private static function doSetupBeforeClass()
}
}

private static function doTearDownAfterClass()
public static function tearDownAfterClass(): void
{
foreach (self::$prefixDirsPsr4 as [$prop, $loader, $prefixDirsPsr4]) {
$prop->setValue($loader, $prefixDirsPsr4);
Expand Down

0 comments on commit ec0c6c2

Please sign in to comment.