From 3d1e5925a0207ff4b604df3a4b22e42610e58676 Mon Sep 17 00:00:00 2001 From: Julian Haagsma Date: Fri, 21 Oct 2016 13:47:40 -0600 Subject: [PATCH] PSR2 compliance, with class alias --- dBug.php | 72 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/dBug.php b/dBug.php index 483888c..65ff4a6 100755 --- a/dBug.php +++ b/dBug.php @@ -1,4 +1,5 @@ -bInitialized) { $header = $this->getVariableName() . " (" . $header . ")"; @@ -132,7 +134,7 @@ class dBug } //create the table row header - function makeTDHeader($type, $header) + private function makeTDHeader($type, $header) { $str_d = ($this->bCollapsed) ? " style=\"display:none\"" : ""; echo " @@ -141,13 +143,13 @@ class dBug } //close table row - function closeTDRow() + private function closeTDRow() { return "\n"; } //error - function error($type) + private function error($type) { $error="Error: Variable cannot be a"; // this just checks if the type starts with a vowel or "x" and displays either "a" or "an" @@ -158,7 +160,7 @@ class dBug } //check variable type - function checkType($var) + private function checkType($var) { switch (gettype($var)) { case "resource": @@ -184,20 +186,20 @@ class dBug } //if variable is a NULL type - function varIsNULL() + private function varIsNULL() { echo "NULL"; } //if variable is a boolean type - function varIsBoolean($var) + private function varIsBoolean($var) { $var=($var==1) ? "TRUE" : "FALSE"; echo $var; } //if variable is an array type - function varIsArray($var) + private function varIsArray($var) { $var_ser = serialize($var); array_push($this->arrHistory, $var_ser); @@ -231,7 +233,7 @@ class dBug } //if variable is an object type - function varIsObject($var) + private function varIsObject($var) { $var_ser = serialize($var); array_push($this->arrHistory, $var_ser); @@ -270,7 +272,7 @@ class dBug } //if variable is a resource type - function varIsResource($var) + private function varIsResource($var) { $this->makeTableHeader("resourceC", "resource", 1); echo "\n\n"; @@ -299,7 +301,7 @@ class dBug } //if variable is a database resource type - function varIsDBResource($var, $db = "mysql") + private function varIsDBResource($var, $db = "mysql") { if ($db == "pgsql") { $db = "pg"; @@ -348,7 +350,7 @@ class dBug } //if variable is an image/gd resource type - function varIsGDResource($var) + private function varIsGDResource($var) { $this->makeTableHeader("resource", "gd", 2); $this->makeTDHeader("resource", "Width"); @@ -361,13 +363,13 @@ class dBug } //if variable is an xml type - function varIsXml($var) + private function varIsXml($var) { $this->varIsXmlResource($var); } //if variable is an xml resource type - function varIsXmlResource($var) + private function varIsXmlResource($var) { $xml_parser=xml_parser_create(); xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 0); @@ -401,7 +403,7 @@ class dBug } //parse xml - function xmlParse($xml_parser, $data, $bFinal) + private function xmlParse($xml_parser, $data, $bFinal) { if (!xml_parse($xml_parser, $data, $bFinal)) { die(sprintf( @@ -413,7 +415,7 @@ class dBug } //xml: inititiated when a start tag is encountered - function xmlStartElement($parser, $name, $attribs) + private function xmlStartElement($parser, $name, $attribs) { $this->xmlAttrib[$this->xmlCount]=$attribs; $this->xmlName[$this->xmlCount]=$name; @@ -431,7 +433,7 @@ class dBug } //xml: initiated when an end tag is encountered - function xmlEndElement($parser, $name) + private function xmlEndElement($parser, $name) { for ($i=0; $i<$this->xmlCount; $i++) { eval($this->xmlSData[$i]); @@ -450,7 +452,7 @@ class dBug } //xml: initiated when text between tags is encountered - function xmlCharacterData($parser, $data) + private function xmlCharacterData($parser, $data) { $count=$this->xmlCount-1; if (!empty($this->xmlCData[$count])) { @@ -461,7 +463,7 @@ class dBug } //xml: initiated when a comment or other miscellaneous texts is encountered - function xmlDefaultHandler($parser, $data) + private function xmlDefaultHandler($parser, $data) { //strip '' off comments $data=str_replace(array("<!--","-->"), "", htmlspecialchars($data)); @@ -473,7 +475,7 @@ class dBug } } - function initJSandCSS() + private function initJSandCSS() { echo <<