Completed
Push — master ( 1857e6...d96bec )
by Joao
03:02
created
src/Database/DBPgsqlFunctions.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
         $sql = "";
11 11
         for ($i = 0, $numArgs = func_num_args(); $i < $numArgs; $i++) {
12 12
             $var = func_get_arg($i);
13
-            $sql .= ($i == 0 ? "" : " || ") . $var;
13
+            $sql .= ($i == 0 ? "" : " || ").$var;
14 14
         }
15 15
 
16 16
         return $sql;
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     function limit($sql, $start, $qty)
27 27
     {
28 28
         if (strpos($sql, ' LIMIT ') === false) {
29
-            return $sql . " LIMIT $qty OFFSET $start ";
29
+            return $sql." LIMIT $qty OFFSET $start ";
30 30
         } else {
31 31
             return $sql;
32 32
         }
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     function sqlDate($fmt, $col = false)
72 72
     {
73 73
         if (!$col) $col = $this->sysTimeStamp;
74
-        $s = 'TO_CHAR(' . $col . ",'";
74
+        $s = 'TO_CHAR('.$col.",'";
75 75
 
76 76
         $len = strlen($fmt);
77 77
         for ($i = 0; $i < $len; $i++) {
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
                     break;
100 100
 
101 101
                 case 'H':
102
-                    $s.= 'HH24';
102
+                    $s .= 'HH24';
103 103
                     break;
104 104
 
105 105
                 case 'h':
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
                     if (strpos('-/.:;, ', $ch) !== false) {
129 129
                         $s .= $ch;
130 130
                     } else {
131
-                        $s .= '"' . $ch . '"';
131
+                        $s .= '"'.$ch.'"';
132 132
                     }
133 133
             }
134 134
         }
135
-        return $s . "')";
135
+        return $s."')";
136 136
     }
137 137
 
138 138
     /**
Please login to merge, or discard this patch.
src/Database/SQLHelper.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
                 if ($sql != "") {
58 58
                     $sql .= ", ";
59 59
                 }
60
-                $sql .= " " . $this->_fieldDeliLeft . $fieldname . $this->_fieldDeliRight . " = " . $this->getValue($fieldname,
61
-                        $fieldvalue, $param, $decimalpoint) . " ";
60
+                $sql .= " ".$this->_fieldDeliLeft.$fieldname.$this->_fieldDeliRight." = ".$this->getValue($fieldname,
61
+                        $fieldvalue, $param, $decimalpoint)." ";
62 62
             }
63 63
             $sql = "update $table set $sql where $filter ";
64 64
         } elseif ($type == SQLType::SQL_INSERT) {
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
                     $campos .= ", ";
70 70
                     $valores .= ", ";
71 71
                 }
72
-                $campos .= $this->_fieldDeliLeft . $fieldname . $this->_fieldDeliRight;
72
+                $campos .= $this->_fieldDeliLeft.$fieldname.$this->_fieldDeliRight;
73 73
                 $valores .= $this->getValue($fieldname, $fieldvalue, $param, $decimalpoint);
74 74
             }
75 75
             $sql = "insert into $table ($campos) values ($valores)";
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      */
94 94
     protected function getValue($name, $valores, &$param, $decimalpoint)
95 95
     {
96
-        $paramName = "[[" . $name . "]]";
96
+        $paramName = "[[".$name."]]";
97 97
         if (!is_array($valores)) {
98 98
             $valores = array(SQLFieldType::TEXT, $valores);
99 99
         }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         } elseif ($valores[0] == SQLFieldType::DATE) {
114 114
             $date = ($valores[1] instanceof DateTime ? $valores[1]->format(DBBaseFunctions::YMDH) : $valores[1]);
115 115
             $param[$name] = $date;
116
-            if (($this->_db->getDbType() == 'oci8') || ( ($this->_db->getDbType() == 'dsn') && (strpos($this->_db->getDbConnectionString(),
116
+            if (($this->_db->getDbType() == 'oci8') || (($this->_db->getDbType() == 'dsn') && (strpos($this->_db->getDbConnectionString(),
117 117
                     "oci8")))) {
118 118
                 return "TO_DATE($paramName, 'YYYY-MM-DD')";
119 119
             } else {
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         if (strlen($sql) > 4) {
144 144
             $sql .= ' and ';
145 145
         }
146
-        $sql = " $fieldName " . $relation . " " . $this->getValue($fieldName, $value, $param, '.');
146
+        $sql = " $fieldName ".$relation." ".$this->getValue($fieldName, $value, $param, '.');
147 147
     }
148 148
 
149 149
     public function setFieldDelimeters($left, $right)
Please login to merge, or discard this patch.
src/Database/DBPDODriver.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -27,15 +27,15 @@  discard block
 block discarded – undo
27 27
 
28 28
         if (is_null($strcnn)) {
29 29
             if ($this->_connectionManagement->getFilePath() != "") {
30
-                $strcnn = $this->_connectionManagement->getDriver() . ":" . $this->_connectionManagement->getFilePath();
30
+                $strcnn = $this->_connectionManagement->getDriver().":".$this->_connectionManagement->getFilePath();
31 31
             } else {
32
-                $strcnn = $this->_connectionManagement->getDriver() . ":dbname=" . $this->_connectionManagement->getDatabase();
32
+                $strcnn = $this->_connectionManagement->getDriver().":dbname=".$this->_connectionManagement->getDatabase();
33 33
                 if ($this->_connectionManagement->getExtraParam("unixsocket") != "") {
34
-                    $strcnn .= ";unix_socket=" . $this->_connectionManagement->getExtraParam("unixsocket");
34
+                    $strcnn .= ";unix_socket=".$this->_connectionManagement->getExtraParam("unixsocket");
35 35
                 } else {
36
-                    $strcnn .= ";host=" . $this->_connectionManagement->getServer();
36
+                    $strcnn .= ";host=".$this->_connectionManagement->getServer();
37 37
                     if ($this->_connectionManagement->getPort() != "") {
38
-                        $strcnn .= ";port=" . $this->_connectionManagement->getPort();
38
+                        $strcnn .= ";port=".$this->_connectionManagement->getPort();
39 39
                     }
40 40
                 }
41 41
             }
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
 
44 44
         // Create Connection
45 45
         $this->_db = new PDO($strcnn, $this->_connectionManagement->getUsername(),
46
-            $this->_connectionManagement->getPassword(), (array) $preOptions);
46
+            $this->_connectionManagement->getPassword(), (array)$preOptions);
47 47
         $this->_connectionManagement->setDriver($this->_db->getAttribute(PDO::ATTR_DRIVER_NAME));
48 48
 
49 49
         // Set Specific Attributes
50 50
         $this->_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
51 51
         $this->_db->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER);
52 52
 
53
-        foreach ((array) $postOptions as $key => $value) {
53
+        foreach ((array)$postOptions as $key => $value) {
54 54
             $this->_db->setAttribute($key, $value);
55 55
         }
56 56
     }
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
             throw new NotAvailableException("Extension 'PDO' is not loaded");
62 62
         }
63 63
 
64
-        if (!extension_loaded('pdo_' . strtolower($connMngt->getDriver()))) {
65
-            throw new NotAvailableException("Extension 'pdo_" . strtolower($connMngt->getDriver()) . "' is not loaded");
64
+        if (!extension_loaded('pdo_'.strtolower($connMngt->getDriver()))) {
65
+            throw new NotAvailableException("Extension 'pdo_".strtolower($connMngt->getDriver())."' is not loaded");
66 66
         }
67 67
 
68
-        $class = '\ByJG\AnyDataset\Database\Pdo' . ucfirst($connMngt->getDriver());
68
+        $class = '\ByJG\AnyDataset\Database\Pdo'.ucfirst($connMngt->getDriver());
69 69
 
70 70
         if (!class_exists($class, true)) {
71 71
             return new DBPDODriver($connMngt, null, null, null);
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             list($sql, $array) = SQLBind::parseSQL($this->_connectionManagement, $sql, $array);
92 92
             $stmt = $this->_db->prepare($sql);
93 93
             foreach ($array as $key => $value) {
94
-                $stmt->bindValue(":" . SQLBind::keyAdj($key), $value);
94
+                $stmt->bindValue(":".SQLBind::keyAdj($key), $value);
95 95
             }
96 96
         } else $stmt = $this->_db->prepare($sql);
97 97
 
Please login to merge, or discard this patch.
src/Database/DBMysqlFunctions.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
         $sql = "concat(";
15 15
         for ($i = 0, $numArgs = func_num_args(); $i < $numArgs; $i++) {
16 16
             $var = func_get_arg($i);
17
-            $sql .= ($i == 0 ? "" : ",") . $var;
17
+            $sql .= ($i == 0 ? "" : ",").$var;
18 18
         }
19 19
         $sql .= ")";
20 20
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     function limit($sql, $start, $qty)
32 32
     {
33 33
         if (strpos($sql, ' LIMIT ') === false) {
34
-            return $sql . " LIMIT $start, $qty ";
34
+            return $sql." LIMIT $start, $qty ";
35 35
         } else {
36 36
             return $sql;
37 37
         }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     function sqlDate($fmt, $col = false)
77 77
     {
78 78
         if (!$col) $col = $this->sysTimeStamp;
79
-        $s = 'DATE_FORMAT(' . $col . ",'";
79
+        $s = 'DATE_FORMAT('.$col.",'";
80 80
         $concat = false;
81 81
         $len = strlen($fmt);
82 82
         for ($i = 0; $i < $len; $i++) {
@@ -137,7 +137,7 @@  discard block
 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.
src/Model/SerializerObject.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@
 block discarded – undo
171 171
                 $keyName = substr($key, strrpos($key, "\0"));
172 172
                 $propertyName = preg_replace($this->getMethodPattern(0), $this->getMethodPattern(1), $keyName);
173 173
 
174
-                if (method_exists($object, $this->getMethodGetPrefix() . $propertyName)) {
174
+                if (method_exists($object, $this->getMethodGetPrefix().$propertyName)) {
175 175
                     $result[$propertyName] = $this->buildProperty($value);
176 176
                 }
177 177
             } else {
Please login to merge, or discard this patch.
src/Model/PropertyAnnotations.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     protected $propForceName;
18 18
     protected $propValue;
19 19
 
20
-    protected $property;  // Reflection objet
20
+    protected $property; // Reflection objet
21 21
     protected $classAnnotation;
22 22
 
23 23
     public function __construct(ClassAnnotations $classAnnotation, $config, $property, $propertyName)
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
                 $this->propName = substr($this->propName, 1);
51 51
             }
52 52
 
53
-            $methodName = $this->classAnnotation->getClassGetter() . ucfirst(preg_replace($this->classAnnotation->getClassPropertyPattern(0),
53
+            $methodName = $this->classAnnotation->getClassGetter().ucfirst(preg_replace($this->classAnnotation->getClassPropertyPattern(0),
54 54
                         $this->classAnnotation->getClassPropertyPattern(1), $this->propName));
55 55
 
56 56
             if ($this->classAnnotation->getClassRefl()->hasMethod($methodName)) {
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $this->annotations = $this->adjustParams($aux);
64 64
         $this->propName = $this->getAnnotations('nodename', $this->propName);
65 65
         if (strpos($this->propName, ":") === false) {
66
-            $this->propName = $this->classAnnotation->getClassDefaultPrefix() . $this->propName;
66
+            $this->propName = $this->classAnnotation->getClassDefaultPrefix().$this->propName;
67 67
         }
68 68
     }
69 69
 
Please login to merge, or discard this patch.
src/Model/BinderObject.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,8 +80,8 @@
 block discarded – undo
80 80
     {
81 81
         if ($obj instanceof SingleRow) {
82 82
             $obj->setField($propName, $value);
83
-        } else if (method_exists($obj, 'set' . $propName)) {
84
-            $obj->{'set' . $propName}($value);
83
+        } else if (method_exists($obj, 'set'.$propName)) {
84
+            $obj->{'set'.$propName}($value);
85 85
         } elseif (isset($obj->{$propName}) || $obj instanceof stdClass) {
86 86
             $obj->{$propName} = $value;
87 87
         } else {
Please login to merge, or discard this patch.
src/Model/ClassAnnotations.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             } else {
67 67
                 $this->propertyList = $this->getClassRefl()->getProperties(
68 68
                     ReflectionProperty::IS_PROTECTED |
69
-                    ReflectionProperty::IS_PRIVATE   |
69
+                    ReflectionProperty::IS_PRIVATE |
70 70
                     ReflectionProperty::IS_PUBLIC
71 71
                 );
72 72
             }
@@ -196,12 +196,12 @@  discard block
 block discarded – undo
196 196
         if (!$this->classNamespace) {
197 197
             $this->classNamespace = $this->getAnnotations("namespace", []);
198 198
             if (!is_array($this->classNamespace) && !empty($this->classNamespace)) {
199
-                $this->classNamespace = [ $this->classNamespace];
199
+                $this->classNamespace = [$this->classNamespace];
200 200
             }
201 201
 
202 202
             foreach ($this->classNamespace as $key => $value) {
203 203
                 $prefix = strtok($value, "!");
204
-                $uri = str_replace($prefix . "!", "", $value);
204
+                $uri = str_replace($prefix."!", "", $value);
205 205
 
206 206
                 $this->classNamespace[$key] = [
207 207
                     $this->classNamespace[$key],
Please login to merge, or discard this patch.