Completed
Push — master ( 116d17...d4b73f )
by Rafael
10s
created
src/Utils.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -8,21 +8,21 @@
 block discarded – undo
8 8
  */
9 9
 abstract class Utils {
10 10
 
11
-  /**
12
-   * Retorna o SQL Formatado e Destacado
13
-   *
14
-   * @param String $query
15
-   */
16
-  public static function dump_sql($query) {
11
+    /**
12
+     * Retorna o SQL Formatado e Destacado
13
+     *
14
+     * @param String $query
15
+     */
16
+    public static function dump_sql($query) {
17 17
     echo SqlFormatter::format($query);
18
-  }
18
+    }
19 19
 
20
-  public static function kill() {
20
+    public static function kill() {
21 21
     call_user_func_array("dump", func_get_args());
22 22
     die("\nFIM\n");
23
-  }
23
+    }
24 24
 
25
-  public static function dump() {
25
+    public static function dump() {
26 26
     return call_user_func_array("dump", func_get_args());
27
-  }
27
+    }
28 28
 }
Please login to merge, or discard this patch.
src/Log.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -3,26 +3,26 @@
 block discarded – undo
3 3
 
4 4
 class Log {
5 5
 
6
-  private static $oInstance;
6
+    private static $oInstance;
7 7
 
8
-  private $oLogger; 
8
+    private $oLogger; 
9 9
 
10
-  private function __construct() {
10
+    private function __construct() {
11 11
 
12 12
     $this->oLogger = new \Monolog\Logger("PHPUtils");
13 13
     $this->oLogger->pushHandler( new \Monolog\Handler\StreamHandler("/tmp/PHPUtils.log") );
14 14
     $this->oLogger->pushHandler( new \Monolog\Handler\ChromePHPHandler() );
15 15
     $this->oLogger->pushHandler( new \Monolog\Handler\FirePHPHandler() );
16
-  }
16
+    }
17 17
 
18
-  public function log() {}
18
+    public function log() {}
19 19
 
20
-  public function debug() { }
20
+    public function debug() { }
21 21
 
22
-  public function warn() { }
22
+    public function warn() { }
23 23
 
24
-  public function info() { }
24
+    public function info() { }
25 25
 
26
-  public function error() {  }
26
+    public function error() {  }
27 27
 
28 28
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,9 +10,9 @@
 block discarded – undo
10 10
   private function __construct() {
11 11
 
12 12
     $this->oLogger = new \Monolog\Logger("PHPUtils");
13
-    $this->oLogger->pushHandler( new \Monolog\Handler\StreamHandler("/tmp/PHPUtils.log") );
14
-    $this->oLogger->pushHandler( new \Monolog\Handler\ChromePHPHandler() );
15
-    $this->oLogger->pushHandler( new \Monolog\Handler\FirePHPHandler() );
13
+    $this->oLogger->pushHandler(new \Monolog\Handler\StreamHandler("/tmp/PHPUtils.log"));
14
+    $this->oLogger->pushHandler(new \Monolog\Handler\ChromePHPHandler());
15
+    $this->oLogger->pushHandler(new \Monolog\Handler\FirePHPHandler());
16 16
   }
17 17
 
18 18
   public function log() {}
Please login to merge, or discard this patch.
src/functions/debug.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 function kill() {
4
-  return call_user_func_array("\\PHP\\Utils::kill", func_get_args());
4
+    return call_user_func_array("\\PHP\\Utils::kill", func_get_args());
5 5
 }
6 6
 
7 7
 function dump_sql($sSql) {
8
-  return \PHP\Utils::dump_sql($sSql);
8
+    return \PHP\Utils::dump_sql($sSql);
9 9
 }
10 10
 
11 11
 function kill_sql($sSql) {
12 12
 
13
-  \PHP\Utils::dump_sql($sSql);
14
-  die("FIM SQL");
13
+    \PHP\Utils::dump_sql($sSql);
14
+    die("FIM SQL");
15 15
 }
16 16
 
17 17
 function debug_array(&$array) {
18
-  return new \PHP\ArrayDebugger($array);
18
+    return new \PHP\ArrayDebugger($array);
19 19
 }
Please login to merge, or discard this patch.
src/ArrayDebugger.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
    * @param string $value
29 29
    * @param array  $backtrace
30 30
    */
31
-  public function sendLog($type, $key, $value = null, array $backtrace ) 
31
+  public function sendLog($type, $key, $value = null, array $backtrace) 
32 32
   {
33 33
 
34 34
       $logger           = $this->logger;
Please login to merge, or discard this patch.
Indentation   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -3,95 +3,95 @@
 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
-      $callbackLogger = $this->logger;
34
-      return $callbackLogger(array(
35
-          'type'  => $type,  
36
-          'key'   => $key,
37
-          'value' => $value,
38
-          'file'  => isset($backtrace[0]['file']) ? $backtrace[0]['file'] : '',
39
-          'line'  => isset($backtrace[0]['line']) ? $backtrace[0]['line'] : '',
40
-      ));
41
-  }
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
+        $callbackLogger = $this->logger;
34
+        return $callbackLogger(array(
35
+            'type'  => $type,  
36
+            'key'   => $key,
37
+            'value' => $value,
38
+            'file'  => isset($backtrace[0]['file']) ? $backtrace[0]['file'] : '',
39
+            'line'  => isset($backtrace[0]['line']) ? $backtrace[0]['line'] : '',
40
+        ));
41
+    }
42 42
 
43
-  /**
44
-   * Defines logger
45
-   *
46
-   * @param \Closure $logger
47
-   */
48
-  public function setLogger(\Closure $logger) 
49
-  {
50
-      $this->logger = $logger;
51
-  }
43
+    /**
44
+     * Defines logger
45
+     *
46
+     * @param \Closure $logger
47
+     */
48
+    public function setLogger(\Closure $logger) 
49
+    {
50
+        $this->logger = $logger;
51
+    }
52 52
 
53
-  /**
54
-   * Called when getting a value from array
55
-   *
56
-   * @param mixed $name
57
-   */
58
-  public function offsetGet($name) 
59
-  { 
60
-      $this->sendLog(static::TYPE_GET, $name, null, debug_backtrace());
61
-      return call_user_func_array('parent::offsetGet', func_get_args()); 
62
-  } 
53
+    /**
54
+     * Called when getting a value from array
55
+     *
56
+     * @param mixed $name
57
+     */
58
+    public function offsetGet($name) 
59
+    { 
60
+        $this->sendLog(static::TYPE_GET, $name, null, debug_backtrace());
61
+        return call_user_func_array('parent::offsetGet', func_get_args()); 
62
+    } 
63 63
 
64
-  /**
65
-   * Called when setting a value from array
66
-   *
67
-   * @param mixed $name
68
-   * @param mixed $value
69
-   */
70
-  public function offsetSet($name, $value) 
71
-  { 
72
-      $this->sendLog(static::TYPE_SET, $name, $value, debug_backtrace());
73
-      return call_user_func_array('parent::offsetSet', func_get_args()); 
74
-  } 
64
+    /**
65
+     * Called when setting a value from array
66
+     *
67
+     * @param mixed $name
68
+     * @param mixed $value
69
+     */
70
+    public function offsetSet($name, $value) 
71
+    { 
72
+        $this->sendLog(static::TYPE_SET, $name, $value, debug_backtrace());
73
+        return call_user_func_array('parent::offsetSet', func_get_args()); 
74
+    } 
75 75
 
76
-  /**
77
-   * Called when checking a value from array 
78
-   *
79
-   * @param mixed $name
80
-   */
81
-  public function offsetExists($name) 
82
-  { 
83
-      $this->sendLog(static::TYPE_EXISTS, $name, null, debug_backtrace());
84
-      return call_user_func_array('parent::offsetExists', func_get_args()); 
85
-  } 
76
+    /**
77
+     * Called when checking a value from array 
78
+     *
79
+     * @param mixed $name
80
+     */
81
+    public function offsetExists($name) 
82
+    { 
83
+        $this->sendLog(static::TYPE_EXISTS, $name, null, debug_backtrace());
84
+        return call_user_func_array('parent::offsetExists', func_get_args()); 
85
+    } 
86 86
 
87
-  /**
88
-   * Called when removing a value from array
89
-   *
90
-   * @param mixed $name
91
-   */
92
-  public function offsetUnset($name) 
93
-  { 
94
-      $this->sendLog(static::TYPE_UNSET, $name, null, debug_backtrace());
95
-      return call_user_func_array('parent::offsetUnset', func_get_args()); 
96
-  } 
87
+    /**
88
+     * Called when removing a value from array
89
+     *
90
+     * @param mixed $name
91
+     */
92
+    public function offsetUnset($name) 
93
+    { 
94
+        $this->sendLog(static::TYPE_UNSET, $name, null, debug_backtrace());
95
+        return call_user_func_array('parent::offsetUnset', func_get_args()); 
96
+    } 
97 97
 } 
Please login to merge, or discard this patch.