From 73cff918c4084155d4ac56287422d8b92cf09870 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Sat, 3 Jun 2023 00:48:42 +0200 Subject: [PATCH] Reach psalm max level --- lib/Doctrine/Deprecations/Deprecation.php | 3 +++ psalm.xml | 2 +- tests/Doctrine/Deprecations/DeprecationTest.php | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/Deprecations/Deprecation.php b/lib/Doctrine/Deprecations/Deprecation.php index 7fba532..07cb43b 100644 --- a/lib/Doctrine/Deprecations/Deprecation.php +++ b/lib/Doctrine/Deprecations/Deprecation.php @@ -225,16 +225,19 @@ private static function basename(string $filename): string public static function enableTrackingDeprecations(): void { + self::$type = self::$type ?? 0; self::$type |= self::TYPE_TRACK_DEPRECATIONS; } public static function enableWithTriggerError(): void { + self::$type = self::$type ?? 0; self::$type |= self::TYPE_TRIGGER_ERROR; } public static function enableWithPsrLogger(LoggerInterface $logger): void { + self::$type = self::$type ?? 0; self::$type |= self::TYPE_PSR_LOGGER; self::$logger = $logger; } diff --git a/psalm.xml b/psalm.xml index 6263958..ad76e32 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,6 +1,6 @@ createMock(LoggerInterface::class); - $mock->method('notice')->with($message, $this->callback(function ($context) use ($identifier, $package) { + $mock->method('notice')->with($message, $this->callback(function (array $context) use ($identifier, $package) { $this->assertEquals($package, $context['package']); $this->assertEquals($identifier, $context['link']);