ErrorHandlerMiddleware.php (cakephp-4.2.2) | : | ErrorHandlerMiddleware.php (cakephp-4.2.3) | ||
---|---|---|---|---|
skipping to change at line 20 | skipping to change at line 20 | |||
* Redistributions of files must retain the above copyright notice. | * Redistributions of files must retain the above copyright notice. | |||
* | * | |||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoun dation.org) | * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoun dation.org) | |||
* @link https://cakephp.org CakePHP(tm) Project | * @link https://cakephp.org CakePHP(tm) Project | |||
* @since 3.3.0 | * @since 3.3.0 | |||
* @license https://opensource.org/licenses/mit-license.php MIT License | * @license https://opensource.org/licenses/mit-license.php MIT License | |||
*/ | */ | |||
namespace Cake\Error\Middleware; | namespace Cake\Error\Middleware; | |||
use Cake\Core\App; | use Cake\Core\App; | |||
use Cake\Core\Configure; | ||||
use Cake\Core\InstanceConfigTrait; | use Cake\Core\InstanceConfigTrait; | |||
use Cake\Error\ErrorHandler; | use Cake\Error\ErrorHandler; | |||
use Cake\Error\ExceptionRenderer; | use Cake\Error\ExceptionRenderer; | |||
use Cake\Http\Exception\RedirectException; | use Cake\Http\Exception\RedirectException; | |||
use Cake\Http\Response; | use Cake\Http\Response; | |||
use InvalidArgumentException; | use InvalidArgumentException; | |||
use Laminas\Diactoros\Response\RedirectResponse; | use Laminas\Diactoros\Response\RedirectResponse; | |||
use Psr\Http\Message\ResponseInterface; | use Psr\Http\Message\ResponseInterface; | |||
use Psr\Http\Message\ServerRequestInterface; | use Psr\Http\Message\ServerRequestInterface; | |||
use Psr\Http\Server\MiddlewareInterface; | use Psr\Http\Server\MiddlewareInterface; | |||
skipping to change at line 95 | skipping to change at line 96 | |||
{ | { | |||
if (func_num_args() > 1) { | if (func_num_args() > 1) { | |||
deprecationWarning( | deprecationWarning( | |||
'The signature of ErrorHandlerMiddleware::__construct() has chan ged. ' | 'The signature of ErrorHandlerMiddleware::__construct() has chan ged. ' | |||
. 'Pass the config array as 1st argument instead.' | . 'Pass the config array as 1st argument instead.' | |||
); | ); | |||
$errorHandler = func_get_arg(1); | $errorHandler = func_get_arg(1); | |||
} | } | |||
if (PHP_VERSION_ID >= 70400 && Configure::read('debug')) { | ||||
ini_set('zend.exception_ignore_args', '0'); | ||||
} | ||||
if (is_array($errorHandler)) { | if (is_array($errorHandler)) { | |||
$this->setConfig($errorHandler); | $this->setConfig($errorHandler); | |||
return; | return; | |||
} | } | |||
if (!$errorHandler instanceof ErrorHandler) { | if (!$errorHandler instanceof ErrorHandler) { | |||
throw new InvalidArgumentException(sprintf( | throw new InvalidArgumentException(sprintf( | |||
'$errorHandler argument must be a config array or ErrorHandler i nstance. Got `%s` instead.', | '$errorHandler argument must be a config array or ErrorHandler i nstance. Got `%s` instead.', | |||
getTypeName($errorHandler) | getTypeName($errorHandler) | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 5 lines changed or added |