diff --git a/src/Monolog/Formatter/MongoDBFormatter.php b/src/Monolog/Formatter/MongoDBFormatter.php index a3bdd4f87..9b7da8a9c 100644 --- a/src/Monolog/Formatter/MongoDBFormatter.php +++ b/src/Monolog/Formatter/MongoDBFormatter.php @@ -154,7 +154,6 @@ private function legacyGetMongoDbDateTime(\DateTimeInterface $value): UTCDateTim ? (int) $milliseconds : (string) $milliseconds; - // @phpstan-ignore-next-line return new UTCDateTime($milliseconds); } } diff --git a/tests/Monolog/Handler/MongoDBHandlerTest.php b/tests/Monolog/Handler/MongoDBHandlerTest.php index 0a518c717..6f293f11e 100644 --- a/tests/Monolog/Handler/MongoDBHandlerTest.php +++ b/tests/Monolog/Handler/MongoDBHandlerTest.php @@ -14,6 +14,9 @@ use MongoDB\Driver\Manager; use Monolog\Test\TestCase; +/** + * @requires extension mongodb + */ class MongoDBHandlerTest extends TestCase { public function testConstructorShouldThrowExceptionForInvalidMongo() @@ -56,10 +59,6 @@ public function testHandleWithLibraryClient() public function testHandleWithDriverManager() { - if (!(class_exists('MongoDB\Driver\Manager'))) { - $this->markTestSkipped('ext-mongodb not installed'); - } - /* This can become a unit test once ManagerInterface can be mocked. * See: https://jira.mongodb.org/browse/PHPC-378 */