mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-01-17 05:18:32 +01:00
Merge pull request #140 from GrahamCampbell/whitespace
Whitespace Cleanup
This commit is contained in:
commit
70cc7ae3b1
@ -13,7 +13,7 @@ A contribution must follow the following guidelines:
|
||||
- Docs must be updated for new features
|
||||
- Changelog must be updated (bug fix are not required to be added to the changelog)
|
||||
- ensure that examples in demo/ folder are still working
|
||||
|
||||
|
||||
Javascript code convention:
|
||||
|
||||
- based on: http://javascript.crockford.com/code.html
|
||||
|
@ -107,4 +107,4 @@ Example:
|
||||
'js' => 'widgets/sqlqueries/widget.js'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,4 +6,4 @@ format data.
|
||||
The default instance is `DebugBar\DataFormatter\DataFormatter`. This can be modified
|
||||
using `DebugBar\DataCollector\DataCollector::setDefaultDataFormatter()`.
|
||||
|
||||
You can use a custom formater for each collector using `DataCollector::setDataFormatter()`.
|
||||
You can use a custom formater for each collector using `DataCollector::setDataFormatter()`.
|
||||
|
@ -50,7 +50,7 @@ class SwiftMailCollector extends DataCollector implements Renderable, AssetProvi
|
||||
protected function formatTo($to)
|
||||
{
|
||||
if (!$to) return '';
|
||||
|
||||
|
||||
$f = array();
|
||||
foreach ($to as $k => $v) {
|
||||
$f[] = (empty($v) ? '' : "$v ") . "<$k>";
|
||||
|
@ -63,4 +63,4 @@ class LocalizationCollector extends DataCollector implements Renderable
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ class DataFormatter implements DataFormatterInterface
|
||||
$suffixes = array('B', 'KB', 'MB', 'GB', 'TB');
|
||||
return round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* lightweight version of Kint::dump(). Uses whitespace for formatting instead of html
|
||||
* sadly not DRY yet
|
||||
@ -170,4 +170,4 @@ class DataFormatter implements DataFormatterInterface
|
||||
return gettype( $var ) . htmlspecialchars( var_export( $var, true ), ENT_NOQUOTES );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -39,4 +39,4 @@ interface DataFormatterInterface
|
||||
* @return string
|
||||
*/
|
||||
function formatBytes($size, $precision = 2);
|
||||
}
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ class DebugBar implements ArrayAccess
|
||||
foreach ($this->collectors as $name => $collector) {
|
||||
$this->data[$name] = $collector->collect();
|
||||
}
|
||||
|
||||
|
||||
// Remove all invalid (non UTF-8) characters
|
||||
array_walk_recursive($this->data, function(&$item){
|
||||
if (is_string($item) && !mb_check_encoding($item, 'UTF-8')) {
|
||||
|
@ -768,9 +768,9 @@ class JavascriptRenderer
|
||||
|
||||
/**
|
||||
* Returns the code needed to display the debug bar
|
||||
*
|
||||
*
|
||||
* AJAX request should not render the initialization code.
|
||||
*
|
||||
*
|
||||
* @param boolean $initialize Whether to render the de bug bar initialization code
|
||||
* @return string
|
||||
*/
|
||||
|
@ -88,4 +88,4 @@ class MemcachedStorage implements StorageInterface
|
||||
{
|
||||
return md5("{$this->keyNamespace}.$id");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,4 +30,4 @@ class DataFormatterTest extends DebugBarTestCase
|
||||
$this->assertEquals("1KB", $f->formatBytes(1024));
|
||||
$this->assertEquals("1MB", $f->formatBytes(1024 * 1024));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user