diff --git a/src/ArrayDebugger.php b/src/ArrayDebugger.php index d26a470..740b34c 100644 --- a/src/ArrayDebugger.php +++ b/src/ArrayDebugger.php @@ -19,6 +19,14 @@ public function __construct() { return call_user_func_array('parent::__construct', func_get_args()); } + /** + * Write log + * + * @param string $type + * @param string $key + * @param string $value + * @param array $backtrace + */ public function sendLog($type, $key, $value = null, array $backtrace ) { $logger = $this->logger; @@ -30,28 +38,54 @@ public function sendLog($type, $key, $value = null, array $backtrace ) { return $logger($retorno); } + /** + * Defines logger + * + * @param \Closure $logger + */ public function setLogger(\Closure $logger) { $this->logger = $logger; } + /** + * Called when getting a value from array + * + * @param mixed $name + */ public function offsetGet($name) { $this->sendLog(static::TYPE_GET, $name, null, debug_backtrace()); return call_user_func_array('parent::offsetGet', func_get_args()); } + /** + * Called when setting a value from array + * + * @param mixed $name + * @param mixed $value + */ public function offsetSet($name, $value) { $this->sendLog(static::TYPE_SET, $name, $value, debug_backtrace()); return call_user_func_array('parent::offsetSet', func_get_args()); } + /** + * Called when checking a value from array + * + * @param mixed $name + */ public function offsetExists($name) { $this->sendLog(static::TYPE_EXISTS, $name, null, debug_backtrace()); return call_user_func_array('parent::offsetExists', func_get_args()); } + /** + * Called when removing a value from array + * + * @param mixed $name + */ public function offsetUnset($name) { $this->sendLog(static::TYPE_UNSET, $name, null, debug_backtrace());