Completed
Push — master ( a88843...acb1bd )
by Rafael
02:11
created
src/ArrayDebugger.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -19,6 +19,9 @@
 block discarded – undo
19 19
     return call_user_func_array('parent::__construct', func_get_args()); 
20 20
   }
21 21
 
22
+  /**
23
+   * @param string $type
24
+   */
22 25
   public function sendLog($type, $key, $value = null, array $backtrace ) {
23 26
 
24 27
     $logger           = $this->logger;
Please login to merge, or discard this patch.
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -3,23 +3,23 @@  discard block
 block discarded – undo
3 3
 
4 4
 class ArrayDebugger extends \ArrayObject { 
5 5
 
6
-  const TYPE_GET    = 'GET';
7
-  const TYPE_SET    = 'SET';
8
-  const TYPE_EXISTS = 'EXISTS';
9
-  const TYPE_UNSET  = 'UNSET';
6
+    const TYPE_GET    = 'GET';
7
+    const TYPE_SET    = 'SET';
8
+    const TYPE_EXISTS = 'EXISTS';
9
+    const TYPE_UNSET  = 'UNSET';
10 10
 
11
-  private $logger;
11
+    private $logger;
12 12
 
13
-  public function __construct() {
13
+    public function __construct() {
14 14
 
15 15
     $this->logger = function($data_log) {
16
-      return dump($data_log);
16
+        return dump($data_log);
17 17
     };
18 18
 
19 19
     return call_user_func_array('parent::__construct', func_get_args()); 
20
-  }
20
+    }
21 21
 
22
-  public function sendLog($type, $key, $value = null, array $backtrace ) {
22
+    public function sendLog($type, $key, $value = null, array $backtrace ) {
23 23
 
24 24
     $logger           = $this->logger;
25 25
     $retorno['type']  = $type;  
@@ -28,33 +28,33 @@  discard block
 block discarded – undo
28 28
     $retorno['file']  = $backtrace[0]['file'];
29 29
     $retorno['line']  = $backtrace[0]['line'];
30 30
     return $logger($retorno);
31
-  }
31
+    }
32 32
 
33
-  public function setLogger(\Closure $logger) {
33
+    public function setLogger(\Closure $logger) {
34 34
     $this->logger = $logger;
35
-  }
35
+    }
36 36
 
37
-  public function offsetGet($name) { 
37
+    public function offsetGet($name) { 
38 38
 
39 39
     $this->sendLog(static::TYPE_GET, $name, null, debug_backtrace());
40 40
     return call_user_func_array('parent::offsetGet', func_get_args()); 
41
-  } 
41
+    } 
42 42
 
43
-  public function offsetSet($name, $value) { 
43
+    public function offsetSet($name, $value) { 
44 44
 
45 45
     $this->sendLog(static::TYPE_SET, $name, $value, debug_backtrace());
46 46
     return call_user_func_array('parent::offsetSet', func_get_args()); 
47
-  } 
47
+    } 
48 48
 
49
-  public function offsetExists($name) { 
49
+    public function offsetExists($name) { 
50 50
 
51 51
     $this->sendLog(static::TYPE_EXISTS, $name, null, debug_backtrace());
52 52
     return call_user_func_array('parent::offsetExists', func_get_args()); 
53
-  } 
53
+    } 
54 54
 
55
-  public function offsetUnset($name) { 
55
+    public function offsetUnset($name) { 
56 56
 
57 57
     $this->sendLog(static::TYPE_UNSET, $name, null, debug_backtrace());
58 58
     return call_user_func_array('parent::offsetUnset', func_get_args()); 
59
-  } 
59
+    } 
60 60
 } 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
     return call_user_func_array('parent::__construct', func_get_args()); 
20 20
   }
21 21
 
22
-  public function sendLog($type, $key, $value = null, array $backtrace ) {
22
+  public function sendLog($type, $key, $value = null, array $backtrace) {
23 23
 
24 24
     $logger           = $this->logger;
25 25
     $retorno['type']  = $type;  
Please login to merge, or discard this patch.
testes.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@
 block discarded – undo
10 10
 //\PHP\Utils::dump($sSql, $oObjeto);
11 11
 
12 12
 $test_array = array(
13
-  "um" => 1,
14
-  "dois" => 2
13
+    "um" => 1,
14
+    "dois" => 2
15 15
 );
16 16
 
17 17
 $test_array = new \PHP\ArrayDebugger($test_array);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 
4 4
 $sSql               = "SELECT * FROM testes.teste inner join  coisa.neh on teste.codigo = neh.codigo where teste.xoxo = 1 and teste.xoxb is true;";
5 5
 $oObjeto            = new StdClass();
6
-$oObjeto->aArray    = array(1,2,3,4,5,"6", array(7));
6
+$oObjeto->aArray    = array(1, 2, 3, 4, 5, "6", array(7));
7 7
 $oObjeto->backtrace = debug_backtrace();
8 8
 
9 9
 //\PHP\Utils::dump_sql($sSql);
@@ -20,5 +20,5 @@  discard block
 block discarded – undo
20 20
 
21 21
 isset($test_array['cinco']);
22 22
 
23
-$teste =  $test_array["4"];
23
+$teste = $test_array["4"];
24 24
 
Please login to merge, or discard this patch.