From f9bfe7fd79048b0b8e476e3da4af8c26eaf67774 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 23 Aug 2020 19:24:34 +0200 Subject: [PATCH 1/3] Allow Drupal to wrap the Symfony test listener --- .../PhpUnit/DeprecationErrorHandler/Deprecation.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php index daab2d2ad57a1..59bcdbcbc6670 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php @@ -12,7 +12,6 @@ namespace Symfony\Bridge\PhpUnit\DeprecationErrorHandler; use PHPUnit\Util\Test; -use Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerFor; /** * @internal @@ -61,10 +60,10 @@ public function __construct($message, array $trace, $file) $line = $trace[$i]; $this->triggeringFile = $file; if (isset($line['object']) || isset($line['class'])) { - if (isset($line['class']) && 0 === strpos($line['class'], SymfonyTestsListenerFor::class)) { - set_error_handler(function () {}); - $parsedMsg = unserialize($this->message); - restore_error_handler(); + set_error_handler(function () {}); + $parsedMsg = unserialize($this->message); + restore_error_handler(); + if ($parsedMsg && isset($parsedMsg['deprecation'])) { $this->message = $parsedMsg['deprecation']; $this->originClass = $parsedMsg['class']; $this->originMethod = $parsedMsg['method']; From ee8cc2666bc8d88c3b4236948f359cb78b5733d3 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Wed, 2 Sep 2020 10:14:45 +0100 Subject: [PATCH 2/3] Swallow errors --- .../Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php index 59bcdbcbc6670..650c8a154382d 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php @@ -61,7 +61,7 @@ public function __construct($message, array $trace, $file) $this->triggeringFile = $file; if (isset($line['object']) || isset($line['class'])) { set_error_handler(function () {}); - $parsedMsg = unserialize($this->message); + $parsedMsg = @unserialize($this->message); restore_error_handler(); if ($parsedMsg && isset($parsedMsg['deprecation'])) { $this->message = $parsedMsg['deprecation']; From 244e8d240829d3732963293a740658925e146443 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Wed, 2 Sep 2020 10:51:41 +0100 Subject: [PATCH 3/3] Revert "Swallow errors" This reverts commit ee8cc2666bc8d88c3b4236948f359cb78b5733d3. --- .../Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php index 650c8a154382d..59bcdbcbc6670 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php @@ -61,7 +61,7 @@ public function __construct($message, array $trace, $file) $this->triggeringFile = $file; if (isset($line['object']) || isset($line['class'])) { set_error_handler(function () {}); - $parsedMsg = @unserialize($this->message); + $parsedMsg = unserialize($this->message); restore_error_handler(); if ($parsedMsg && isset($parsedMsg['deprecation'])) { $this->message = $parsedMsg['deprecation']; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy