Skip to content

Commit d2c828d

Browse files
committed
Modern code formatting.
1 parent ad7139f commit d2c828d

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
@@ -385,22 +385,32 @@ protected function _writeHeader($data)
385385
$header = self::HEADER_NAME . ': ' . $this->_encode($data);
386386
// Most HTTPD servers have a default header line length limit of 8kb, must test to avoid 500 Internal Server Error.
387387
if (strlen($header) > self::HTTPD_HEADER_LIMIT) {
388-
$data['rows'] = array();
389-
$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);
388+
$data['rows'] = [];
389+
$data['rows'][] = [
390+
[
391+
'ChromePHP Error: The HTML header will surpass the limit of ' .
392+
$this->_formatSize(self::HTTPD_HEADER_LIMIT) . ' (' . $this->_formatSize(strlen($header)) .
393+
') - You can increase the HTTPD_HEADER_LIMIT on ChromePHP class, according to your Apache ' .
394+
'LimitRequestFieldsize directive'
395+
], '', self::ERROR
396+
];
390397
$header = self::HEADER_NAME . ': ' . $this->_encode($data);
391398
}
392399
header($header);
393400
}
394401

395402
protected function _formatSize($arg) {
396-
if ($arg>0){
403+
if ($arg > 0) {
397404
$j = 0;
398-
$ext = array("bytes","Kb","Mb","Gb","Tb");
399-
while ($arg >= pow(1024,$j)) ++$j; {
400-
$arg = (round($arg/pow(1024,$j-1)*100)/100).($ext[$j-1]);
405+
$ext = ["bytes","Kb","Mb","Gb","Tb"];
406+
while ($arg >= pow(1024, $j)) ++$j; {
407+
$arg = (round($arg / pow(1024, $j - 1) * 100) / 100).($ext[$j - 1]);
401408
}
409+
402410
return $arg;
403-
} else return "0Kb";
411+
}
412+
413+
return "0Kb";
404414
}
405415

406416
/**

0 commit comments

Comments
 (0)