Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/flow-flo.../libs/cakephp/core/Exceptio...
File: Exception.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
[2] Fix | Delete
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
[3] Fix | Delete
*
[4] Fix | Delete
* Licensed under The MIT License
[5] Fix | Delete
* Redistributions of files must retain the above copyright notice.
[6] Fix | Delete
*
[7] Fix | Delete
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
[8] Fix | Delete
* @since 3.0.0
[9] Fix | Delete
* @license https://opensource.org/licenses/mit-license.php MIT License
[10] Fix | Delete
*/
[11] Fix | Delete
namespace Cake\Core\Exception;
[12] Fix | Delete
[13] Fix | Delete
use RuntimeException;
[14] Fix | Delete
[15] Fix | Delete
/**
[16] Fix | Delete
* Base class that all CakePHP Exceptions extend.
[17] Fix | Delete
*
[18] Fix | Delete
* @method int getCode()
[19] Fix | Delete
*/
[20] Fix | Delete
class Exception extends RuntimeException
[21] Fix | Delete
{
[22] Fix | Delete
/**
[23] Fix | Delete
* Array of attributes that are passed in from the constructor, and
[24] Fix | Delete
* made available in the view when a development error is displayed.
[25] Fix | Delete
*
[26] Fix | Delete
* @var array
[27] Fix | Delete
*/
[28] Fix | Delete
protected $_attributes = [];
[29] Fix | Delete
[30] Fix | Delete
/**
[31] Fix | Delete
* Template string that has attributes sprintf()'ed into it.
[32] Fix | Delete
*
[33] Fix | Delete
* @var string
[34] Fix | Delete
*/
[35] Fix | Delete
protected $_messageTemplate = '';
[36] Fix | Delete
[37] Fix | Delete
/**
[38] Fix | Delete
* Array of headers to be passed to Cake\Http\Response::header()
[39] Fix | Delete
*
[40] Fix | Delete
* @var array|null
[41] Fix | Delete
*/
[42] Fix | Delete
protected $_responseHeaders;
[43] Fix | Delete
[44] Fix | Delete
/**
[45] Fix | Delete
* Default exception code
[46] Fix | Delete
*
[47] Fix | Delete
* @var int
[48] Fix | Delete
*/
[49] Fix | Delete
protected $_defaultCode = 500;
[50] Fix | Delete
[51] Fix | Delete
/**
[52] Fix | Delete
* Constructor.
[53] Fix | Delete
*
[54] Fix | Delete
* Allows you to create exceptions that are treated as framework errors and disabled
[55] Fix | Delete
* when debug mode is off.
[56] Fix | Delete
*
[57] Fix | Delete
* @param string|array $message Either the string of the error message, or an array of attributes
[58] Fix | Delete
* that are made available in the view, and sprintf()'d into Exception::$_messageTemplate
[59] Fix | Delete
* @param int|null $code The code of the error, is also the HTTP status code for the error.
[60] Fix | Delete
* @param \Exception|null $previous the previous exception.
[61] Fix | Delete
*/
[62] Fix | Delete
public function __construct($message = '', $code = null, $previous = null)
[63] Fix | Delete
{
[64] Fix | Delete
if ($code === null) {
[65] Fix | Delete
$code = $this->_defaultCode;
[66] Fix | Delete
}
[67] Fix | Delete
[68] Fix | Delete
if (is_array($message)) {
[69] Fix | Delete
$this->_attributes = $message;
[70] Fix | Delete
$message = vsprintf($this->_messageTemplate, $message);
[71] Fix | Delete
}
[72] Fix | Delete
parent::__construct($message, $code, $previous);
[73] Fix | Delete
}
[74] Fix | Delete
[75] Fix | Delete
/**
[76] Fix | Delete
* Get the passed in attributes
[77] Fix | Delete
*
[78] Fix | Delete
* @return array
[79] Fix | Delete
*/
[80] Fix | Delete
public function getAttributes()
[81] Fix | Delete
{
[82] Fix | Delete
return $this->_attributes;
[83] Fix | Delete
}
[84] Fix | Delete
[85] Fix | Delete
/**
[86] Fix | Delete
* Get/set the response header to be used
[87] Fix | Delete
*
[88] Fix | Delete
* See also Cake\Http\Response::withHeader()
[89] Fix | Delete
*
[90] Fix | Delete
* @param string|array|null $header An array of header strings or a single header string
[91] Fix | Delete
* - an associative array of "header name" => "header value"
[92] Fix | Delete
* - an array of string headers is also accepted (deprecated)
[93] Fix | Delete
* @param string|null $value The header value.
[94] Fix | Delete
* @return array|null
[95] Fix | Delete
*/
[96] Fix | Delete
public function responseHeader($header = null, $value = null)
[97] Fix | Delete
{
[98] Fix | Delete
if ($header === null) {
[99] Fix | Delete
return $this->_responseHeaders;
[100] Fix | Delete
}
[101] Fix | Delete
if (is_array($header)) {
[102] Fix | Delete
if (isset($header[0])) {
[103] Fix | Delete
deprecationWarning(
[104] Fix | Delete
'Passing a list string headers to Exception::responseHeader() is deprecated. ' .
[105] Fix | Delete
'Use an associative array instead.'
[106] Fix | Delete
);
[107] Fix | Delete
}
[108] Fix | Delete
[109] Fix | Delete
return $this->_responseHeaders = $header;
[110] Fix | Delete
}
[111] Fix | Delete
$this->_responseHeaders = [$header => $value];
[112] Fix | Delete
}
[113] Fix | Delete
}
[114] Fix | Delete
[115] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function