Completed
Push — master ( 497518...867338 )
by Joao
04:19
created
src/Database/DBBaseFunctions.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 
55 55
     /**
56 56
      * Return if the database provider have a top or similar function
57
-     * @return unknown_type
57
+     * @return boolean
58 58
      */
59 59
     function hasTop()
60 60
     {
Please login to merge, or discard this patch.
src/Database/DBDblibFunctions.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 
44 44
     /**
45 45
      * Return if the database provider have a top or similar function
46
-     * @return unknown_type
46
+     * @return boolean
47 47
      */
48 48
     function hasTop()
49 49
     {
Please login to merge, or discard this patch.
Switch Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -76,50 +76,50 @@
 block discarded – undo
76 76
             if ($s) $s .= '+';
77 77
             $ch = $fmt[$i];
78 78
             switch ($ch) {
79
-                case 'Y':
80
-                case 'y':
81
-                    $s .= "datename(yyyy,$col)";
82
-                    break;
83
-                case 'M':
84
-                    $s .= "convert(char(3),$col,0)";
85
-                    break;
86
-                case 'm':
87
-                    $s .= "replace(str(month($col),2),' ','0')";
88
-                    break;
89
-                case 'Q':
90
-                case 'q':
91
-                    $s .= "datename(quarter,$col)";
92
-                    break;
93
-                case 'D':
94
-                case 'd':
95
-                    $s .= "replace(str(day($col),2),' ','0')";
96
-                    break;
97
-                case 'h':
98
-                    $s .= "substring(convert(char(14),$col,0),13,2)";
99
-                    break;
100
-
101
-                case 'H':
102
-                    $s .= "replace(str(datepart(hh,$col),2),' ','0')";
103
-                    break;
104
-
105
-                case 'i':
106
-                    $s .= "replace(str(datepart(mi,$col),2),' ','0')";
107
-                    break;
108
-                case 's':
109
-                    $s .= "replace(str(datepart(ss,$col),2),' ','0')";
110
-                    break;
111
-                case 'a':
112
-                case 'A':
113
-                    $s .= "substring(convert(char(19),$col,0),18,2)";
114
-                    break;
115
-
116
-                default:
117
-                    if ($ch == '\\') {
118
-                        $i++;
119
-                        $ch = substr($fmt, $i, 1);
120
-                    }
121
-                    $s .= $this->qstr($ch);
122
-                    break;
79
+            case 'Y':
80
+            case 'y':
81
+                $s .= "datename(yyyy,$col)";
82
+                break;
83
+            case 'M':
84
+                $s .= "convert(char(3),$col,0)";
85
+                break;
86
+            case 'm':
87
+                $s .= "replace(str(month($col),2),' ','0')";
88
+                break;
89
+            case 'Q':
90
+            case 'q':
91
+                $s .= "datename(quarter,$col)";
92
+                break;
93
+            case 'D':
94
+            case 'd':
95
+                $s .= "replace(str(day($col),2),' ','0')";
96
+                break;
97
+            case 'h':
98
+                $s .= "substring(convert(char(14),$col,0),13,2)";
99
+                break;
100
+
101
+            case 'H':
102
+                $s .= "replace(str(datepart(hh,$col),2),' ','0')";
103
+                break;
104
+
105
+            case 'i':
106
+                $s .= "replace(str(datepart(mi,$col),2),' ','0')";
107
+                break;
108
+            case 's':
109
+                $s .= "replace(str(datepart(ss,$col),2),' ','0')";
110
+                break;
111
+            case 'a':
112
+            case 'A':
113
+                $s .= "substring(convert(char(19),$col,0),18,2)";
114
+                break;
115
+
116
+            default:
117
+                if ($ch == '\\') {
118
+                    $i++;
119
+                    $ch = substr($fmt, $i, 1);
120
+                }
121
+                $s .= $this->qstr($ch);
122
+                break;
123 123
             }
124 124
         }
125 125
         return $s;
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,12 +68,16 @@
 block discarded – undo
68 68
      */
69 69
     function sqlDate($fmt, $col = false)
70 70
     {
71
-        if (!$col) $col = "getdate()";
71
+        if (!$col) {
72
+            $col = "getdate()";
73
+        }
72 74
         $s = '';
73 75
 
74 76
         $len = strlen($fmt);
75 77
         for ($i = 0; $i < $len; $i++) {
76
-            if ($s) $s .= '+';
78
+            if ($s) {
79
+                $s .= '+';
80
+            }
77 81
             $ch = $fmt[$i];
78 82
             switch ($ch) {
79 83
                 case 'Y':
Please login to merge, or discard this patch.
src/Database/DBMysqlFunctions.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
 
51 51
     /**
52 52
      * Return if the database provider have a top or similar function
53
-     * @return unknown_type
53
+     * @return boolean
54 54
      */
55 55
     function hasTop()
56 56
     {
Please login to merge, or discard this patch.
Switch Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -82,59 +82,59 @@
 block discarded – undo
82 82
         for ($i = 0; $i < $len; $i++) {
83 83
             $ch = $fmt[$i];
84 84
             switch ($ch) {
85
-                case 'Y':
86
-                case 'y':
87
-                    $s .= '%Y';
88
-                    break;
89
-                case 'Q':
90
-                case 'q':
91
-                    $s .= "'),Quarter($col)";
92
-
93
-                    if ($len > $i + 1) $s .= ",DATE_FORMAT($col,'";
94
-                    else $s .= ",('";
95
-                    $concat = true;
96
-                    break;
97
-                case 'M':
98
-                    $s .= '%b';
99
-                    break;
100
-
101
-                case 'm':
102
-                    $s .= '%m';
103
-                    break;
104
-                case 'D':
105
-                case 'd':
106
-                    $s .= '%d';
107
-                    break;
108
-
109
-                case 'H':
110
-                    $s .= '%H';
111
-                    break;
112
-
113
-                case 'h':
114
-                    $s .= '%I';
115
-                    break;
116
-
117
-                case 'i':
118
-                    $s .= '%i';
119
-                    break;
120
-
121
-                case 's':
122
-                    $s .= '%s';
123
-                    break;
124
-
125
-                case 'a':
126
-                case 'A':
127
-                    $s .= '%p';
128
-                    break;
129
-
130
-                default:
131
-
132
-                    if ($ch == '\\') {
133
-                        $i++;
134
-                        $ch = substr($fmt, $i, 1);
135
-                    }
136
-                    $s .= $ch;
137
-                    break;
85
+            case 'Y':
86
+            case 'y':
87
+                $s .= '%Y';
88
+                break;
89
+            case 'Q':
90
+            case 'q':
91
+                $s .= "'),Quarter($col)";
92
+
93
+                if ($len > $i + 1) $s .= ",DATE_FORMAT($col,'";
94
+                else $s .= ",('";
95
+                $concat = true;
96
+                break;
97
+            case 'M':
98
+                $s .= '%b';
99
+                break;
100
+
101
+            case 'm':
102
+                $s .= '%m';
103
+                break;
104
+            case 'D':
105
+            case 'd':
106
+                $s .= '%d';
107
+                break;
108
+
109
+            case 'H':
110
+                $s .= '%H';
111
+                break;
112
+
113
+            case 'h':
114
+                $s .= '%I';
115
+                break;
116
+
117
+            case 'i':
118
+                $s .= '%i';
119
+                break;
120
+
121
+            case 's':
122
+                $s .= '%s';
123
+                break;
124
+
125
+            case 'a':
126
+            case 'A':
127
+                $s .= '%p';
128
+                break;
129
+
130
+            default:
131
+
132
+                if ($ch == '\\') {
133
+                    $i++;
134
+                    $ch = substr($fmt, $i, 1);
135
+                }
136
+                $s .= $ch;
137
+                break;
138 138
             }
139 139
         }
140 140
         $s.="')";
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@
 block discarded – undo
137 137
                     break;
138 138
             }
139 139
         }
140
-        $s.="')";
140
+        $s .= "')";
141 141
         if ($concat) $s = "CONCAT($s)";
142 142
         return $s;
143 143
     }
Please login to merge, or discard this patch.
Braces   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -75,7 +75,9 @@  discard block
 block discarded – undo
75 75
      */
76 76
     function sqlDate($fmt, $col = false)
77 77
     {
78
-        if (!$col) $col = $this->sysTimeStamp;
78
+        if (!$col) {
79
+            $col = $this->sysTimeStamp;
80
+        }
79 81
         $s = 'DATE_FORMAT(' . $col . ",'";
80 82
         $concat = false;
81 83
         $len = strlen($fmt);
@@ -90,8 +92,11 @@  discard block
 block discarded – undo
90 92
                 case 'q':
91 93
                     $s .= "'),Quarter($col)";
92 94
 
93
-                    if ($len > $i + 1) $s .= ",DATE_FORMAT($col,'";
94
-                    else $s .= ",('";
95
+                    if ($len > $i + 1) {
96
+                        $s .= ",DATE_FORMAT($col,'";
97
+                    } else {
98
+                        $s .= ",('";
99
+                    }
95 100
                     $concat = true;
96 101
                     break;
97 102
                 case 'M':
@@ -138,7 +143,9 @@  discard block
 block discarded – undo
138 143
             }
139 144
         }
140 145
         $s.="')";
141
-        if ($concat) $s = "CONCAT($s)";
146
+        if ($concat) {
147
+            $s = "CONCAT($s)";
148
+        }
142 149
         return $s;
143 150
     }
144 151
 
Please login to merge, or discard this patch.
src/Database/DBOci8Driver.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -185,7 +185,7 @@
 block discarded – undo
185 185
 
186 186
     /**
187 187
      *
188
-     * @return handle
188
+     * @return resource|null
189 189
      */
190 190
     public function getDbConnection()
191 191
     {
Please login to merge, or discard this patch.
src/Database/DBPgsqlFunctions.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
 
45 45
     /**
46 46
      * Return if the database provider have a top or similar function
47
-     * @return unknown_type
47
+     * @return boolean
48 48
      */
49 49
     function hasTop()
50 50
     {
Please login to merge, or discard this patch.
Switch Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -76,59 +76,59 @@
 block discarded – undo
76 76
         for ($i = 0; $i < $len; $i++) {
77 77
             $ch = $fmt[$i];
78 78
             switch ($ch) {
79
-                case 'Y':
80
-                case 'y':
81
-                    $s .= 'YYYY';
82
-                    break;
83
-                case 'Q':
84
-                case 'q':
85
-                    $s .= 'Q';
86
-                    break;
87
-
88
-                case 'M':
89
-                    $s .= 'Mon';
90
-                    break;
91
-
92
-                case 'm':
93
-                    $s .= 'MM';
94
-                    break;
95
-                case 'D':
96
-                case 'd':
97
-                    $s .= 'DD';
98
-                    break;
99
-
100
-                case 'H':
101
-                    $s.= 'HH24';
102
-                    break;
103
-
104
-                case 'h':
105
-                    $s .= 'HH';
106
-                    break;
107
-
108
-                case 'i':
109
-                    $s .= 'MI';
110
-                    break;
111
-
112
-                case 's':
113
-                    $s .= 'SS';
114
-                    break;
115
-
116
-                case 'a':
117
-                case 'A':
118
-                    $s .= 'AM';
119
-                    break;
120
-
121
-                default:
122
-                    // handle escape characters...
123
-                    if ($ch == '\\') {
124
-                        $i++;
125
-                        $ch = substr($fmt, $i, 1);
126
-                    }
127
-                    if (strpos('-/.:;, ', $ch) !== false) {
128
-                        $s .= $ch;
129
-                    } else {
130
-                        $s .= '"' . $ch . '"';
131
-                    }
79
+            case 'Y':
80
+            case 'y':
81
+                $s .= 'YYYY';
82
+                break;
83
+            case 'Q':
84
+            case 'q':
85
+                $s .= 'Q';
86
+                break;
87
+
88
+            case 'M':
89
+                $s .= 'Mon';
90
+                break;
91
+
92
+            case 'm':
93
+                $s .= 'MM';
94
+                break;
95
+            case 'D':
96
+            case 'd':
97
+                $s .= 'DD';
98
+                break;
99
+
100
+            case 'H':
101
+                $s.= 'HH24';
102
+                break;
103
+
104
+            case 'h':
105
+                $s .= 'HH';
106
+                break;
107
+
108
+            case 'i':
109
+                $s .= 'MI';
110
+                break;
111
+
112
+            case 's':
113
+                $s .= 'SS';
114
+                break;
115
+
116
+            case 'a':
117
+            case 'A':
118
+                $s .= 'AM';
119
+                break;
120
+
121
+            default:
122
+                // handle escape characters...
123
+                if ($ch == '\\') {
124
+                    $i++;
125
+                    $ch = substr($fmt, $i, 1);
126
+                }
127
+                if (strpos('-/.:;, ', $ch) !== false) {
128
+                    $s .= $ch;
129
+                } else {
130
+                    $s .= '"' . $ch . '"';
131
+                }
132 132
             }
133 133
         }
134 134
         return $s . "')";
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
                     break;
99 99
 
100 100
                 case 'H':
101
-                    $s.= 'HH24';
101
+                    $s .= 'HH24';
102 102
                     break;
103 103
 
104 104
                 case 'h':
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,9 @@
 block discarded – undo
69 69
      */
70 70
     function sqlDate($fmt, $col = false)
71 71
     {
72
-        if (!$col) $col = $this->sysTimeStamp;
72
+        if (!$col) {
73
+            $col = $this->sysTimeStamp;
74
+        }
73 75
         $s = 'TO_CHAR(' . $col . ",'";
74 76
 
75 77
         $len = strlen($fmt);
Please login to merge, or discard this patch.
src/Database/DBSQLRelayDriver.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -25,6 +25,9 @@
 block discarded – undo
25 25
     protected $_conn;
26 26
     protected $_transaction = false;
27 27
 
28
+    /**
29
+     * @param ConnectionManagement $connMngt
30
+     */
28 31
     public function __construct($connMngt)
29 32
     {
30 33
         $this->_connectionManagement = $connMngt;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
             sqlrcur_prepareQuery($cur, $sql);
57 57
             $bindCount = 1;
58 58
             foreach ($array as $key => $value) {
59
-                $field = strval($bindCount ++);
59
+                $field = strval($bindCount++);
60 60
                 sqlrcur_inputBind($cur, $field, $value);
61 61
             }
62 62
             $success = sqlrcur_executeQuery($cur);
Please login to merge, or discard this patch.
src/Database/SQLBind.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
      *
34 34
      * @param ConnectionManagement $connData
35 35
      * @param string $sql
36
-     * @param array $param
36
+     * @param array $params
37 37
      * @return array An array with the adjusted SQL and PARAMs
38 38
      */
39 39
     public static function parseSQL(ConnectionManagement $connData, $sql, $params = null)
Please login to merge, or discard this patch.
src/Database/SQLHelper.php 2 patches
Doc Comments   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,6 @@  discard block
 block discarded – undo
32 32
     /**
33 33
      * Generate and Execute UPDATE and INSERTS
34 34
      *
35
-     * @param DBDataset $db
36 35
      * @param string $table
37 36
      * @param array $fields
38 37
      * @param SQLType $type
@@ -148,6 +147,9 @@  discard block
 block discarded – undo
148 147
         $this->_fieldDeliRight = $right;
149 148
     }
150 149
 
150
+    /**
151
+     * @param string $sql
152
+     */
151 153
     public static function createSafeSQL($sql, $list)
152 154
     {
153 155
         foreach ($list as $key => $value) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
         } elseif ($valores[0] == SQLFieldType::DATE) {
110 110
             $date = ($valores[1] instanceof DateTime ? $valores[1]->format(DBBaseFunctions::YMDH) : $valores[1]);
111 111
             $param[$name] = $date;
112
-            if (($this->_db->getDbType() == 'oci8') || ( ($this->_db->getDbType() == 'dsn') && (strpos($this->_db->getDbConnectionString(),
112
+            if (($this->_db->getDbType() == 'oci8') || (($this->_db->getDbType() == 'dsn') && (strpos($this->_db->getDbConnectionString(),
113 113
                     "oci8")))) {
114 114
                 return "TO_DATE($paramName, 'YYYY-MM-DD')";
115 115
             } else {
Please login to merge, or discard this patch.
src/Enum/FixedTextDefinition.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
      * @param string $fieldName
20 20
      * @param int $startPos
21 21
      * @param int $length
22
-     * @param bool $requiredValue
22
+     * @param string|boolean $requiredValue
23 23
      * @param array_of_FixedTextDefinition $subTypes
24 24
      */
25 25
     public function __construct($fieldName, $startPos, $length, $requiredValue = "", $subTypes = null)
Please login to merge, or discard this patch.