Completed
Push — master ( a52629...cbc88e )
by Joao
04:07
created
src/Database/BaseDBAccess.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
         $start = 0;
87 87
         if ($debug) {
88 88
             $log = LogHandler::getInstance();
89
-            $log->debug("Class name: " . get_class($this));
90
-            $log->debug("SQL: " . $sql);
89
+            $log->debug("Class name: ".get_class($this));
90
+            $log->debug("SQL: ".$sql);
91 91
             if (!is_null($param)) {
92 92
                 $s = "";
93 93
                 foreach ($param as $key => $value) {
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
         if ($debug) {
112 112
             $end = microtime(true);
113
-            $log->debug("Execution time: " . ($end - $start) . " seconds ");
113
+            $log->debug("Execution time: ".($end - $start)." seconds ");
114 114
         }
115 115
 
116 116
         return $id;
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
         $start = 0;
132 132
         if ($debug) {
133 133
             $log = LogHandler::getInstance();
134
-            $log->debug("Class name: " . get_class($this));
135
-            $log->debug("SQL: " . $sql);
134
+            $log->debug("Class name: ".get_class($this));
135
+            $log->debug("SQL: ".$sql);
136 136
             if (!is_null($param)) {
137 137
                 $s = "";
138 138
                 foreach ($param as $key => $value) {
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
         $it = $db->getIterator($sql, $param, $ttl);
149 149
         if ($debug) {
150 150
             $end = microtime(true);
151
-            $log->debug("Execution Time: " . ($end - $start) . " segundos ");
151
+            $log->debug("Execution Time: ".($end - $start)." segundos ");
152 152
         }
153 153
         return $it;
154 154
     }
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
         $start = 0;
162 162
         if ($debug) {
163 163
             $log = LogHandler::getInstance();
164
-            $log->debug("Class name: " . get_class($this));
165
-            $log->debug("SQL: " . $sql);
164
+            $log->debug("Class name: ".get_class($this));
165
+            $log->debug("SQL: ".$sql);
166 166
             if (!is_null($param)) {
167 167
                 $s = "";
168 168
                 foreach ($param as $key => $value) {
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         $scalar = $this->_db->getScalar($sql, $param);
179 179
         if ($debug) {
180 180
             $end = microtime(true);
181
-            $log->debug("Execution Time: " . ($end - $start) . " segundos ");
181
+            $log->debug("Execution Time: ".($end - $start)." segundos ");
182 182
         }
183 183
         return $scalar;
184 184
     }
@@ -262,14 +262,14 @@  discard block
 block discarded – undo
262 262
                     $fields = $sr->getFieldNames();
263 263
                 }
264 264
 
265
-                $line .= '"' . implode('","', $fields) . '"' . "\n";
265
+                $line .= '"'.implode('","', $fields).'"'."\n";
266 266
             }
267 267
 
268 268
             $raw = array();
269 269
             foreach ($fields as $field) {
270 270
                 $raw[] = $sr->getField($field);
271 271
             }
272
-            $line .= '"' . implode('","', array_values($raw)) . '"' . "\n";
272
+            $line .= '"'.implode('","', array_values($raw)).'"'."\n";
273 273
 
274 274
             if ($echoToBrowser) {
275 275
                 echo $line;
Please login to merge, or discard this patch.
src/Database/DBOci8Driver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -63,9 +63,9 @@
 block discarded – undo
63 63
 
64 64
         $host = $connMngt->getServer();
65 65
 
66
-        $tns = "(DESCRIPTION = " .
67
-            "	(ADDRESS = (PROTOCOL = $protocol)(HOST = $host)(PORT = $port)) " .
68
-            "		(CONNECT_DATA = (SERVICE_NAME = $svcName)) " .
66
+        $tns = "(DESCRIPTION = ".
67
+            "	(ADDRESS = (PROTOCOL = $protocol)(HOST = $host)(PORT = $port)) ".
68
+            "		(CONNECT_DATA = (SERVICE_NAME = $svcName)) ".
69 69
             ")";
70 70
 
71 71
         return $tns;
Please login to merge, or discard this patch.
src/Model/BaseModel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
         if (is_null($pattern)) {
43 43
             $this->_propertyPattern = null;
44 44
         } else {
45
-            $this->_propertyPattern = array(($pattern[0] != "/" ? "/" : "") . $pattern . ($pattern[strlen($pattern) - 1]
45
+            $this->_propertyPattern = array(($pattern[0] != "/" ? "/" : "").$pattern.($pattern[strlen($pattern) - 1]
46 46
                 != "/" ? "/" : ""), $replace);
47 47
         }
48 48
     }
Please login to merge, or discard this patch.
src/Model/ObjectHandler.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
         // Check the proper treatment
71 71
         if (is_array($model)) {
72
-            $this->_model = (object) $model;
72
+            $this->_model = (object)$model;
73 73
             $this->_currentArray = true;
74 74
 
75 75
             // Fix First Level non-associative arrays
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             isset($classAttributes["$this->_config:rdftype"]) ? $classAttributes["$this->_config:rdftype"] : "{HOST}/rdf/class/{CLASS}");
163 163
         $classMeta[ObjectHandler::CLASS_RDF_ABOUT] = $this->replaceVars($classMeta[ObjectHandler::CLASS_NAME],
164 164
             isset($classAttributes["$this->_config:rdfabout"]) ? $classAttributes["$this->_config:rdfabout"] : "{HOST}/rdf/instance/{CLASS}/{GetID()}");
165
-        $classMeta[ObjectHandler::CLASS_DEFAULT_PREFIX] = isset($classAttributes["$this->_config:defaultprefix"]) ? $classAttributes["$this->_config:defaultprefix"] . ":"
165
+        $classMeta[ObjectHandler::CLASS_DEFAULT_PREFIX] = isset($classAttributes["$this->_config:defaultprefix"]) ? $classAttributes["$this->_config:defaultprefix"].":"
166 166
                 : "";
167 167
         $classMeta[ObjectHandler::CLASS_IS_RDF] = ($classMeta[ObjectHandler::CLASS_DOC_TYPE] == "rdf");
168 168
         $classMeta[ObjectHandler::CLASS_IGNORE_ALL_CLASS] = array_key_exists("$this->_config:ignore", $classAttributes);
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                 $propName = substr($propName, 1);
214 214
             }
215 215
 
216
-            $methodName = $classMeta[ObjectHandler::CLASS_GETTER] . ucfirst(preg_replace($classMeta[ObjectHandler::CLASS_PROPERTY_PATTERN][0],
216
+            $methodName = $classMeta[ObjectHandler::CLASS_GETTER].ucfirst(preg_replace($classMeta[ObjectHandler::CLASS_PROPERTY_PATTERN][0],
217 217
                         $classMeta[ObjectHandler::CLASS_PROPERTY_PATTERN][1], $propName));
218 218
             if ($classMeta[ObjectHandler::CLASS_REFL]->hasMethod($methodName)) {
219 219
                 $method = $classMeta[ObjectHandler::CLASS_REFL]->getMethod($methodName);
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
         $propMeta[ObjectHandler::PROP_FORCE_NAME] = isset($propAttributes["$this->_config:dontcreatenode"]) ? $propAttributes["$this->_config:dontcreatenode"]
235 235
                 : "";
236 236
         if (strpos($propMeta[ObjectHandler::PROP_NAME], ":") === false) {
237
-            $propMeta[ObjectHandler::PROP_NAME] = $classMeta[ObjectHandler::CLASS_DEFAULT_PREFIX] . $propMeta[ObjectHandler::PROP_NAME];
237
+            $propMeta[ObjectHandler::PROP_NAME] = $classMeta[ObjectHandler::CLASS_DEFAULT_PREFIX].$propMeta[ObjectHandler::PROP_NAME];
238 238
         }
239 239
         if ($propMeta[ObjectHandler::PROP_NAME] == ObjectHandler::OBJECT_ARRAY_IGNORE_NODE) {
240 240
             $propMeta[ObjectHandler::PROP_DONT_CREATE_NODE] = true;
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
         if (is_array($classMeta[ObjectHandler::CLASS_NAMESPACE])) {
261 261
             foreach ($classMeta[ObjectHandler::CLASS_NAMESPACE] as $value) {
262 262
                 $prefix = strtok($value, "!");
263
-                $uri = str_replace($prefix . "!", "", $value);
263
+                $uri = str_replace($prefix."!", "", $value);
264 264
                 XmlUtil::AddNamespaceToDocument($this->_current, $prefix,
265 265
                     $this->replaceVars($classMeta[ObjectHandler::CLASS_NAME], $uri));
266 266
             }
@@ -319,8 +319,8 @@  discard block
 block discarded – undo
319 319
                 # Value is an ARRAY?
320 320
                 elseif (is_array($propMeta[ObjectHandler::PROP_VALUE])) {
321 321
                     // Check if the array is associative or dont.
322
-                    $isAssoc = (bool) count(array_filter(array_keys($propMeta[ObjectHandler::PROP_VALUE]), 'is_string'));
323
-                    $hasScalar = (bool) count(array_filter(array_values($propMeta[ObjectHandler::PROP_VALUE]),
322
+                    $isAssoc = (bool)count(array_filter(array_keys($propMeta[ObjectHandler::PROP_VALUE]), 'is_string'));
323
+                    $hasScalar = (bool)count(array_filter(array_values($propMeta[ObjectHandler::PROP_VALUE]),
324 324
                                 function($val) {
325 325
                                 return !(is_object($val) || is_array($val));
326 326
                             }));
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
                     if ($propMeta[ObjectHandler::PROP_DONT_CREATE_NODE] || (!$isAssoc && $hasScalar)) {
331 331
                         $nodeUsed = $node;
332 332
                     } else if ((!$isAssoc && !$hasScalar)) {
333
-                        $lazyCreate = true;    // Have to create the node every iteration
333
+                        $lazyCreate = true; // Have to create the node every iteration
334 334
                     } else {
335 335
                         $nodeUsed = $used = XmlUtil::CreateChild($node, $propMeta[ObjectHandler::PROP_NAME]);
336 336
                     }
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
         # Host
419 419
         $port = isset($_SERVER["SERVER_PORT"]) ? $_SERVER["SERVER_PORT"] : 80;
420 420
         $httpHost = isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : 'localhost';
421
-        $host = ($port == 443 ? "https://" : "http://") . $httpHost;
421
+        $host = ($port == 443 ? "https://" : "http://").$httpHost;
422 422
 
423 423
         # Replace Part One
424 424
         $text = preg_replace(array("/\{[hH][oO][sS][tT]\}/", "/\{[cC][lL][aA][sS][sS]\}/"), array($host, $name), $text);
@@ -466,15 +466,15 @@  discard block
 block discarded – undo
466 466
         if ($value instanceof SimpleXMLElement) {
467 467
             $x = array();
468 468
             foreach ($value->children() as $k => $v) {
469
-                $text = "" . $v;
469
+                $text = "".$v;
470 470
                 if ($text != "") {
471 471
                     $arText = array($text);
472 472
                 } else {
473 473
                     $arText = array();
474 474
                 }
475
-                $x[$k][] = (array) $v + $arText;
475
+                $x[$k][] = (array)$v + $arText;
476 476
             }
477
-            $value = (array) $value->attributes() + $x;
477
+            $value = (array)$value->attributes() + $x;
478 478
         }
479 479
 
480 480
         // Fix empty arrays or with one element only.
@@ -536,9 +536,9 @@  discard block
 block discarded – undo
536 536
         }
537 537
 
538 538
         if ($xml->getName() == "xmlnuke") {
539
-            $array = (array) $xml->children();
539
+            $array = (array)$xml->children();
540 540
         } else {
541
-            $array = (array) $xml;
541
+            $array = (array)$xml;
542 542
         }
543 543
 
544 544
         array_walk($array, "ByJG\AnyDataset\Model\ObjectHandler::mapArray");
@@ -550,6 +550,6 @@  discard block
 block discarded – undo
550 550
             $json = json_encode($array);
551 551
         }
552 552
 
553
-        return $jsonFunction . $pre . $json . $pos;
553
+        return $jsonFunction.$pre.$json.$pos;
554 554
     }
555 555
 }
Please login to merge, or discard this patch.
src/Model/Object.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
             }
163 163
         }
164 164
 
165
-        if (method_exists($obj, 'get' . $propName)) {
166
-            if (is_callable([$obj, 'get' . $propName])) {
167
-                return $obj->{'get' . $propName}();
165
+        if (method_exists($obj, 'get'.$propName)) {
166
+            if (is_callable([$obj, 'get'.$propName])) {
167
+                return $obj->{'get'.$propName}();
168 168
             }
169 169
         } else if (is_null($prop)) {
170 170
             return $obj->{$propName};
@@ -195,8 +195,8 @@  discard block
 block discarded – undo
195 195
 
196 196
         if ($obj instanceof SingleRow) {
197 197
             $obj->setField($propName, $value);
198
-        } else if (method_exists($obj, 'set' . $propName)) {
199
-            $obj->{'set' . $propName}($value);
198
+        } else if (method_exists($obj, 'set'.$propName)) {
199
+            $obj->{'set'.$propName}($value);
200 200
         } elseif (isset($obj->{$propName}) || $obj instanceof stdClass) {
201 201
             $obj->{$propName} = $value;
202 202
         } else {
Please login to merge, or discard this patch.
src/Repository/IteratorFilter.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         if ($xpathFilter == "") {
38 38
             return "/anydataset/row";
39 39
         } else {
40
-            return "/anydataset/row[" . $xpathFilter . "]";
40
+            return "/anydataset/row[".$xpathFilter."]";
41 41
         }
42 42
     }
43 43
 
@@ -136,33 +136,33 @@  discard block
 block discarded – undo
136 136
     private function getStrXpathRelation($name, $relation, $value)
137 137
     {
138 138
         $str = is_numeric($value) ? "" : "'";
139
-        $field = "field[@name='" . $name . "'] ";
139
+        $field = "field[@name='".$name."'] ";
140 140
         $value = " $str$value$str ";
141 141
 
142 142
         $result = "";
143 143
         switch ($relation) {
144 144
             case Relation::EQUAL: {
145
-                    $result = $field . "=" . $value;
145
+                    $result = $field."=".$value;
146 146
                     break;
147 147
                 }
148 148
             case Relation::GREATER_THAN: {
149
-                    $result = $field . ">" . $value;
149
+                    $result = $field.">".$value;
150 150
                     break;
151 151
                 }
152 152
             case Relation::LESS_THAN: {
153
-                    $result = $field . "<" . $value;
153
+                    $result = $field."<".$value;
154 154
                     break;
155 155
                 }
156 156
             case Relation::GREATER_OR_EQUAL_THAN: {
157
-                    $result = $field . ">=" . $value;
157
+                    $result = $field.">=".$value;
158 158
                     break;
159 159
                 }
160 160
             case Relation::LESS_OR_EQUAL_THAN: {
161
-                    $result = $field . "<=" . $value;
161
+                    $result = $field."<=".$value;
162 162
                     break;
163 163
                 }
164 164
             case Relation::NOT_EQUAL: {
165
-                    $result = $field . "!=" . $value;
165
+                    $result = $field."!=".$value;
166 166
                     break;
167 167
                 }
168 168
             case Relation::STARTS_WITH: {
@@ -191,47 +191,47 @@  discard block
 block discarded – undo
191 191
         $paramName = $name;
192 192
         $i = 0;
193 193
         while (array_key_exists($paramName, $param)) {
194
-            $paramName = $name . ($i++);
194
+            $paramName = $name.($i++);
195 195
         }
196 196
 
197 197
         $param[$paramName] = $value;
198 198
 
199 199
         $result = "";
200 200
         $field = " $name ";
201
-        $valueparam = " [[" . $paramName . "]] ";
201
+        $valueparam = " [[".$paramName."]] ";
202 202
         switch ($relation) {
203 203
             case Relation::EQUAL: {
204
-                    $result = $field . "=" . $valueparam;
204
+                    $result = $field."=".$valueparam;
205 205
                     break;
206 206
                 }
207 207
             case Relation::GREATER_THAN: {
208
-                    $result = $field . ">" . $valueparam;
208
+                    $result = $field.">".$valueparam;
209 209
                     break;
210 210
                 }
211 211
             case Relation::LESS_THAN: {
212
-                    $result = $field . "<" . $valueparam;
212
+                    $result = $field."<".$valueparam;
213 213
                     break;
214 214
                 }
215 215
             case Relation::GREATER_OR_EQUAL_THAN: {
216
-                    $result = $field . ">=" . $valueparam;
216
+                    $result = $field.">=".$valueparam;
217 217
                     break;
218 218
                 }
219 219
             case Relation::LESS_OR_EQUAL_THAN: {
220
-                    $result = $field . "<=" . $valueparam;
220
+                    $result = $field."<=".$valueparam;
221 221
                     break;
222 222
                 }
223 223
             case Relation::NOT_EQUAL: {
224
-                    $result = $field . "!=" . $valueparam;
224
+                    $result = $field."!=".$valueparam;
225 225
                     break;
226 226
                 }
227 227
             case Relation::STARTS_WITH: {
228
-                    $param[$paramName] = $value . "%";
229
-                    $result = $field . " like " . $valueparam;
228
+                    $param[$paramName] = $value."%";
229
+                    $result = $field." like ".$valueparam;
230 230
                     break;
231 231
                 }
232 232
             case Relation::CONTAINS: {
233
-                    $param[$paramName] = "%" . $value . "%";
234
-                    $result = $field . " like " . $valueparam;
233
+                    $param[$paramName] = "%".$value."%";
234
+                    $result = $field." like ".$valueparam;
235 235
                     break;
236 236
                 }
237 237
         }
Please login to merge, or discard this patch.
src/Repository/DBDataset.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@
 block discarded – undo
148 148
     public function getDbFunctions()
149 149
     {
150 150
         if (is_null($this->_dbFunction)) {
151
-            $dbFunc = "\\ByJG\\AnyDataset\\Database\\DB" . ucfirst($this->_connectionManagement->getDriver()) . "Functions";
151
+            $dbFunc = "\\ByJG\\AnyDataset\\Database\\DB".ucfirst($this->_connectionManagement->getDriver())."Functions";
152 152
             $this->_dbFunction = new $dbFunc();
153 153
         }
154 154
 
Please login to merge, or discard this patch.
src/Repository/SocketDataset.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,8 +54,8 @@
 block discarded – undo
54 54
         if (!$handle) {
55 55
             throw new DatasetException("Socket error: $errstr ($errno)");
56 56
         } else {
57
-            $out = "GET " . $this->_path . " HTTP/1.1\r\n";
58
-            $out .= "Host: " . $this->_server . "\r\n";
57
+            $out = "GET ".$this->_path." HTTP/1.1\r\n";
58
+            $out .= "Host: ".$this->_server."\r\n";
59 59
             $out .= "Connection: Close\r\n\r\n";
60 60
 
61 61
             fwrite($handle, $out);
Please login to merge, or discard this patch.
src/Repository/SocketIterator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,10 +42,10 @@  discard block
 block discarded – undo
42 42
         }
43 43
 
44 44
         $this->_rows = array();
45
-        $rowsaux = preg_split("/" . $this->_rowsep . "/", $linha);
45
+        $rowsaux = preg_split("/".$this->_rowsep."/", $linha);
46 46
         sort($rowsaux);
47 47
         foreach ($rowsaux as $key => $value) {
48
-            $colsaux = preg_split("/" . $this->_colsep . "/", $value);
48
+            $colsaux = preg_split("/".$this->_colsep."/", $value);
49 49
             if (sizeof($colsaux) == sizeof($fieldnames)) {
50 50
                 $this->_rows[] = $value;
51 51
             }
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      */
79 79
     public function moveNext()
80 80
     {
81
-        $cols = preg_split("/" . $this->_colsep . "/", $this->_rows[$this->_current]);
81
+        $cols = preg_split("/".$this->_colsep."/", $this->_rows[$this->_current]);
82 82
         $this->_current++;
83 83
 
84 84
         $sr = new SingleRow();
Please login to merge, or discard this patch.