mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Fix up code formatting and structure for #3998
* Fix the various PHPCS errors. * Make the logic less complex.
This commit is contained in:
parent
e08b8148a5
commit
0b85c35635
1 changed files with 12 additions and 13 deletions
|
@ -517,20 +517,19 @@ class CakeResponse {
|
||||||
* @param string $name the header name
|
* @param string $name the header name
|
||||||
* @param string $value the header value
|
* @param string $value the header value
|
||||||
* @return void
|
* @return void
|
||||||
* @throws CakeException When an header already been sent
|
* @throws CakeException When headers have already been sent
|
||||||
*/
|
*/
|
||||||
protected function _sendHeader($name, $value = null) {
|
protected function _sendHeader($name, $value = null) {
|
||||||
if (!headers_sent($filename, $linenum)) {
|
if (headers_sent($filename, $linenum)) {
|
||||||
if ($value === null) {
|
throw new CakeException(
|
||||||
header($name);
|
__d('cake_dev', 'Headers already sent in %d on line %s', $linenum, $filename)
|
||||||
} else {
|
);
|
||||||
header("{$name}: {$value}");
|
}
|
||||||
}
|
if ($value === null) {
|
||||||
} else {
|
header($name);
|
||||||
if (Configure::read('debug')) {
|
} else {
|
||||||
throw new CakeException(__d('cake_dev', 'Headers already sent in $filename on line $linenum'));
|
header("{$name}: {$value}");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue