Completed
Push — master ( a88843...acb1bd )
by Rafael
02:11
created
src/functions/debug.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@
 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
 }
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/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.
src/Utils.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -2,27 +2,27 @@
 block discarded – undo
2 2
 namespace PHP;
3 3
 use SqlFormatter;
4 4
 /**
5
- * Utilitários para desenvolvimento
6
- *
7
- * @abstract
8
- */
5
+     * Utilitários para desenvolvimento
6
+     *
7
+     * @abstract
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.