avoid notice but accept any other alert from PHP

This commit is contained in:
fbsanchez 2021-07-27 11:24:23 +02:00
parent 3c78bfc89e
commit 9206dc491e

View File

@ -1342,14 +1342,14 @@ class Client
function ($errno, $errstr) { function ($errno, $errstr) {
throw new \Exception($errstr, $errno); throw new \Exception($errstr, $errno);
}, },
E_ERROR (E_ALL ^ E_NOTICE)
); );
register_shutdown_function( register_shutdown_function(
function () { function () {
$error = error_get_last(); $error = error_get_last();
if (null !== $error if (null !== $error
&& $error['type'] === E_ERROR && $error['type'] === (E_ALL ^ E_NOTICE)
) { ) {
echo __('Failed to analyze package: %s', $error['message']); echo __('Failed to analyze package: %s', $error['message']);
} }
@ -1434,7 +1434,7 @@ class Client
function ($errno, $errstr) { function ($errno, $errstr) {
throw new \Exception($errstr, $errno); throw new \Exception($errstr, $errno);
}, },
E_ERROR (E_ALL ^ E_NOTICE)
); );
if ($package === null) { if ($package === null) {