From ac9f4ac86d1004b1c74ee1943cbaa4f24ad8aa7f Mon Sep 17 00:00:00 2001 From: David Zuelke Date: Thu, 9 Dec 2021 02:30:25 +0100 Subject: [PATCH] port from main/2.1: ignore all Return type deprecation warnings from Symfony and Composer namespaces (47cf602f9e900a9da65e01a91b3f94a4aacbf7c7, 2be03f0d60a17b2fb05bb88d1754a84bf84641fc) --- src/Composer/Util/ErrorHandler.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Composer/Util/ErrorHandler.php b/src/Composer/Util/ErrorHandler.php index c4dabd1d7..a504c4b0a 100644 --- a/src/Composer/Util/ErrorHandler.php +++ b/src/Composer/Util/ErrorHandler.php @@ -52,6 +52,12 @@ class ErrorHandler } if (self::$io) { + // ignore symfony/* deprecation warnings about return types + // also ignore them from the Composer namespace, as 1.x won't get all that fixed anymore + if (preg_match('{^Return type of (Symfony|Composer)\\\\.*ReturnTypeWillChange}is', $message)) { + return true; + } + self::$io->writeError('Deprecation Notice: '.$message.' in '.$file.':'.$line.''); if (self::$io->isVerbose()) { self::$io->writeError('Stack trace:');