Skip to content

Commit 7165c1d

Browse files
committed
Modern code formatting.
1 parent 171e152 commit 7165c1d

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

ChromePhp.php

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -399,22 +399,32 @@ protected function _writeHeader($data)
399399
$header = self::HEADER_NAME . ': ' . $this->_encode($data);
400400
// Most HTTPD servers have a default header line length limit of 8kb, must test to avoid 500 Internal Server Error.
401401
if (strlen($header) > self::HTTPD_HEADER_LIMIT) {
402-
$data['rows'] = array();
403-
$data['rows'][] = array(array('ChromePHP Error: The HTML header will surpass the limit of '.$this->_formatSize(self::HTTPD_HEADER_LIMIT).' ('.$this->_formatSize(strlen($header)).') - You can increase the HTTPD_HEADER_LIMIT on ChromePHP class, according to your Apache LimitRequestFieldsize directive'), '', self::ERROR);
402+
$data['rows'] = [];
403+
$data['rows'][] = [
404+
[
405+
'ChromePHP Error: The HTML header will surpass the limit of ' .
406+
$this->_formatSize(self::HTTPD_HEADER_LIMIT) . ' (' . $this->_formatSize(strlen($header)) .
407+
') - You can increase the HTTPD_HEADER_LIMIT on ChromePHP class, according to your Apache ' .
408+
'LimitRequestFieldsize directive'
409+
], '', self::ERROR
410+
];
404411
$header = self::HEADER_NAME . ': ' . $this->_encode($data);
405412
}
406413
header($header);
407414
}
408415

409416
protected function _formatSize($arg) {
410-
if ($arg>0){
417+
if ($arg > 0) {
411418
$j = 0;
412-
$ext = array("bytes","Kb","Mb","Gb","Tb");
413-
while ($arg >= pow(1024,$j)) ++$j; {
414-
$arg = (round($arg/pow(1024,$j-1)*100)/100).($ext[$j-1]);
419+
$ext = ["bytes","Kb","Mb","Gb","Tb"];
420+
while ($arg >= pow(1024, $j)) ++$j; {
421+
$arg = (round($arg / pow(1024, $j - 1) * 100) / 100).($ext[$j - 1]);
415422
}
423+
416424
return $arg;
417-
} else return "0Kb";
425+
}
426+
427+
return "0Kb";
418428
}
419429

420430
/**

0 commit comments

Comments
 (0)