Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions ChromePhp.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,33 +244,31 @@ public static function table()
* internal logging call
*
* @param string $type
* @return void
* @return ChromePhp
*/
protected static function _log($type, array $args)
{
$logger = self::getInstance();

// nothing passed in, don't do anything
if (count($args) == 0 && $type != self::GROUP_END) {
return;
if (empty($args) && $type != self::GROUP_END) {
return $logger;
}

$logger = self::getInstance();

$logger->_processed = array();

$logs = array();
foreach ($args as $arg) {
$logs[] = $logger->_convert($arg);
}
$logs = array_map(array($logger, '_convert'), $args);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the array syntax should be short syntax because of consistency. Using the [....] instead.

And this short syntax is supported sine the php-5.4+.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in PR #6.


$backtrace = debug_backtrace(false);
$level = $logger->getSetting(self::BACKTRACE_LEVEL);

$backtrace_message = 'unknown';
if (isset($backtrace[$level]['file']) && isset($backtrace[$level]['line'])) {
if (isset($backtrace[$level]['file'], $backtrace[$level]['line'])) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is about two styles for presenting check two values will be set.

If we accept this, we should change all related conditions to this in this respo.

$backtrace_message = $backtrace[$level]['file'] . ' : ' . $backtrace[$level]['line'];
}

$logger->_addRow($logs, $backtrace_message, $type);

return $logger;
}

/**
Expand Down