Completed
Pull Request — master (#8)
by Rafael
02:08
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   +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.