Completed
Pull Request — master (#8)
by Rafael
02:08
created
src/ArrayDebugger.php 1 patch
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -3,94 +3,94 @@
 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() 
14
-  {
13
+    public function __construct() 
14
+    {
15 15
 
16
-      $this->logger = function($data_log) {
16
+        $this->logger = function($data_log) {
17 17
         dump($data_log);
18
-      };
18
+        };
19 19
 
20
-      call_user_func_array('parent::__construct', func_get_args()); 
21
-  }
20
+        call_user_func_array('parent::__construct', func_get_args()); 
21
+    }
22 22
 
23
-  /**
24
-   * Write log
25
-   *
26
-   * @param string $type
27
-   * @param string $key
28
-   * @param string $value
29
-   * @param array  $backtrace
30
-   */
31
-  public function sendLog($type, $key, $value = null, array $backtrace ) 
32
-  {
33
-      return $this->logger(array(
34
-          'type'  => $type,  
35
-          'key'   => $key,
36
-          'value' => $value,
37
-          'file'  => isset($backtrace[0]['file']) ? $backtrace[0]['file'] : '',
38
-          'line'  => isset($backtrace[0]['line']) ? $backtrace[0]['line'] : '',
39
-      ));
40
-  }
23
+    /**
24
+     * Write log
25
+     *
26
+     * @param string $type
27
+     * @param string $key
28
+     * @param string $value
29
+     * @param array  $backtrace
30
+     */
31
+    public function sendLog($type, $key, $value = null, array $backtrace ) 
32
+    {
33
+        return $this->logger(array(
34
+            'type'  => $type,  
35
+            'key'   => $key,
36
+            'value' => $value,
37
+            'file'  => isset($backtrace[0]['file']) ? $backtrace[0]['file'] : '',
38
+            'line'  => isset($backtrace[0]['line']) ? $backtrace[0]['line'] : '',
39
+        ));
40
+    }
41 41
 
42
-  /**
43
-   * Defines logger
44
-   *
45
-   * @param \Closure $logger
46
-   */
47
-  public function setLogger(\Closure $logger) 
48
-  {
49
-      $this->logger = $logger;
50
-  }
42
+    /**
43
+     * Defines logger
44
+     *
45
+     * @param \Closure $logger
46
+     */
47
+    public function setLogger(\Closure $logger) 
48
+    {
49
+        $this->logger = $logger;
50
+    }
51 51
 
52
-  /**
53
-   * Called when getting a value from array
54
-   *
55
-   * @param mixed $name
56
-   */
57
-  public function offsetGet($name) 
58
-  { 
59
-      $this->sendLog(static::TYPE_GET, $name, null, debug_backtrace());
60
-      return call_user_func_array('parent::offsetGet', func_get_args()); 
61
-  } 
52
+    /**
53
+     * Called when getting a value from array
54
+     *
55
+     * @param mixed $name
56
+     */
57
+    public function offsetGet($name) 
58
+    { 
59
+        $this->sendLog(static::TYPE_GET, $name, null, debug_backtrace());
60
+        return call_user_func_array('parent::offsetGet', func_get_args()); 
61
+    } 
62 62
 
63
-  /**
64
-   * Called when setting a value from array
65
-   *
66
-   * @param mixed $name
67
-   * @param mixed $value
68
-   */
69
-  public function offsetSet($name, $value) 
70
-  { 
71
-      $this->sendLog(static::TYPE_SET, $name, $value, debug_backtrace());
72
-      return call_user_func_array('parent::offsetSet', func_get_args()); 
73
-  } 
63
+    /**
64
+     * Called when setting a value from array
65
+     *
66
+     * @param mixed $name
67
+     * @param mixed $value
68
+     */
69
+    public function offsetSet($name, $value) 
70
+    { 
71
+        $this->sendLog(static::TYPE_SET, $name, $value, debug_backtrace());
72
+        return call_user_func_array('parent::offsetSet', func_get_args()); 
73
+    } 
74 74
 
75
-  /**
76
-   * Called when checking a value from array 
77
-   *
78
-   * @param mixed $name
79
-   */
80
-  public function offsetExists($name) 
81
-  { 
82
-      $this->sendLog(static::TYPE_EXISTS, $name, null, debug_backtrace());
83
-      return call_user_func_array('parent::offsetExists', func_get_args()); 
84
-  } 
75
+    /**
76
+     * Called when checking a value from array 
77
+     *
78
+     * @param mixed $name
79
+     */
80
+    public function offsetExists($name) 
81
+    { 
82
+        $this->sendLog(static::TYPE_EXISTS, $name, null, debug_backtrace());
83
+        return call_user_func_array('parent::offsetExists', func_get_args()); 
84
+    } 
85 85
 
86
-  /**
87
-   * Called when removing a value from array
88
-   *
89
-   * @param mixed $name
90
-   */
91
-  public function offsetUnset($name) 
92
-  { 
93
-      $this->sendLog(static::TYPE_UNSET, $name, null, debug_backtrace());
94
-      return call_user_func_array('parent::offsetUnset', func_get_args()); 
95
-  } 
86
+    /**
87
+     * Called when removing a value from array
88
+     *
89
+     * @param mixed $name
90
+     */
91
+    public function offsetUnset($name) 
92
+    { 
93
+        $this->sendLog(static::TYPE_UNSET, $name, null, debug_backtrace());
94
+        return call_user_func_array('parent::offsetUnset', func_get_args()); 
95
+    } 
96 96
 } 
Please login to merge, or discard this patch.