1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-31 19:30:21 +02:00

Remove trailing whitespace.

Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
This commit is contained in:
Edward Z. Yang
2008-12-06 02:28:20 -05:00
parent 3a6b63dff1
commit 2c955af135
476 changed files with 5595 additions and 5547 deletions

View File

@@ -2,7 +2,7 @@
/**
* Debugging tools.
*
*
* This file gives a developer a set of tools useful for performing code
* consistency checks. This includes scoping code blocks to ensure that
* only the interesting iteration of a loop gets outputted, a paint()
@@ -61,62 +61,62 @@ function isInScopes($array = array()) {
*/
class Debugger
{
public $shouldPaint = false;
public $paints = 0;
public $current_scopes = array();
public $scope_nextID = 1;
public $add_pre = true;
public function Debugger() {
$this->add_pre = !extension_loaded('xdebug');
}
public static function &instance() {
static $soleInstance = false;
if (!$soleInstance) $soleInstance = new Debugger();
return $soleInstance;
}
public function paintIf($mixed, $conditional) {
if (!$conditional) return;
$this->paint($mixed);
}
public function paintWhen($mixed, $scopes = array()) {
if (!$this->isInScopes($scopes)) return;
$this->paint($mixed);
}
public function paintIfWhen($mixed, $conditional, $scopes = array()) {
if (!$conditional) return;
if (!$this->isInScopes($scopes)) return;
$this->paint($mixed);
}
public function paint($mixed) {
$this->paints++;
if($this->add_pre) echo '<pre>';
var_dump($mixed);
if($this->add_pre) echo '</pre>';
}
public function addScope($id = false) {
if ($id == false) {
$id = $this->scope_nextID++;
}
$this->current_scopes[$id] = true;
}
public function removeScope($id) {
if (isset($this->current_scopes[$id])) unset($this->current_scopes[$id]);
}
public function resetScopes() {
$this->current_scopes = array();
$this->scope_nextID = 1;
}
public function isInScopes($scopes = array()) {
if (empty($this->current_scopes)) {
return false;
@@ -141,6 +141,6 @@ class Debugger
}
return true;
}
}