Test Setup Failed
Branch master (0ff4f4)
by Christopher
06:18
created
src/POData/UriProcessor/XML2Array.php 3 patches
Doc Comments   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@  discard block
 block discarded – undo
17 17
     }
18 18
     /**
19 19
      * Convert an XML to Array
20
-     * @param string $node_name - name of the root node to be converted
21
-     * @param array $arr - aray to be converterd
20
+     * @param string $input_xml
22 21
      * @return DOMDocument
23 22
      */
24 23
     public static function &createArray($input_xml) {
@@ -40,7 +39,7 @@  discard block
 block discarded – undo
40 39
     }
41 40
     /**
42 41
      * Convert an Array to XML
43
-     * @param mixed $node - XML as a string or as an object of DOMDocument
42
+     * @param \DOMElement $node - XML as a string or as an object of DOMDocument
44 43
      * @return mixed
45 44
      */
46 45
     private static function &convert($node) {
Please login to merge, or discard this patch.
Indentation   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 
4 4
 class XML2Array {
5 5
     private static $xml = null;
6
-	private static $encoding = 'UTF-8';
6
+    private static $encoding = 'UTF-8';
7 7
     /**
8 8
      * Initialize the root XML node [optional]
9 9
      * @param $version
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     public static function init($version = '1.0', $encoding = 'UTF-8', $format_output = true) {
14 14
         self::$xml = new \DOMDocument($version, $encoding);
15 15
         self::$xml->formatOutput = $format_output;
16
-		self::$encoding = $encoding;
16
+        self::$encoding = $encoding;
17 17
     }
18 18
     /**
19 19
      * Convert an XML to Array
@@ -23,18 +23,18 @@  discard block
 block discarded – undo
23 23
      */
24 24
     public static function &createArray($input_xml) {
25 25
         $xml = self::getXMLRoot();
26
-		if(is_string($input_xml)) {
27
-			$parsed = $xml->loadXML($input_xml);
28
-			if(!$parsed) {
29
-				throw new \Exception('[XML2Array] Error parsing the XML string.');
30
-			}
31
-		} else {
32
-			if(get_class($input_xml) != 'DOMDocument') {
33
-				throw new \Exception('[XML2Array] The input XML object should be of type: DOMDocument.');
34
-			}
35
-			$xml = self::$xml = $input_xml;
36
-		}
37
-		$array[$xml->documentElement->tagName] = self::convert($xml->documentElement);
26
+        if(is_string($input_xml)) {
27
+            $parsed = $xml->loadXML($input_xml);
28
+            if(!$parsed) {
29
+                throw new \Exception('[XML2Array] Error parsing the XML string.');
30
+            }
31
+        } else {
32
+            if(get_class($input_xml) != 'DOMDocument') {
33
+                throw new \Exception('[XML2Array] The input XML object should be of type: DOMDocument.');
34
+            }
35
+            $xml = self::$xml = $input_xml;
36
+        }
37
+        $array[$xml->documentElement->tagName] = self::convert($xml->documentElement);
38 38
         self::$xml = null;    // clear the xml node in the class for 2nd time use.
39 39
         return $array;
40 40
     }
@@ -44,60 +44,60 @@  discard block
 block discarded – undo
44 44
      * @return mixed
45 45
      */
46 46
     private static function &convert($node) {
47
-		$output = array();
48
-		switch ($node->nodeType) {
49
-			case XML_CDATA_SECTION_NODE:
50
-				$output['@cdata'] = trim($node->textContent);
51
-				break;
52
-			case XML_TEXT_NODE:
53
-				$output = trim($node->textContent);
54
-				break;
55
-			case XML_ELEMENT_NODE:
56
-				// for each child node, call the covert function recursively
57
-				for ($i=0, $m=$node->childNodes->length; $i<$m; $i++) {
58
-					$child = $node->childNodes->item($i);
59
-					$v = self::convert($child);
60
-					if(isset($child->tagName)) {
61
-						$t = $child->tagName;
62
-						// assume more nodes of same kind are coming
63
-						if(!isset($output[$t])) {
64
-							$output[$t] = array();
65
-						}
66
-						$output[$t][] = $v;
67
-					} else {
68
-						//check if it is not an empty text node
69
-						if($v !== '') {
70
-							$output = $v;
71
-						}
72
-					}
73
-				}
74
-				if(is_array($output)) {
75
-					// if only one node of its kind, assign it directly instead if array($value);
76
-					foreach ($output as $t => $v) {
77
-						if(is_array($v) && count($v)==1) {
78
-							$output[$t] = $v[0];
79
-						}
80
-					}
81
-					if(empty($output)) {
82
-						//for empty nodes
83
-						$output = '';
84
-					}
85
-				}
86
-				// loop through the attributes and collect them
87
-				if($node->attributes->length) {
88
-					$a = array();
89
-					foreach($node->attributes as $attrName => $attrNode) {
90
-						$a[$attrName] = (string) $attrNode->value;
91
-					}
92
-					// if its an leaf node, store the value in @value instead of directly storing it.
93
-					if(!is_array($output)) {
94
-						$output = array('@value' => $output);
95
-					}
96
-					$output['@attributes'] = $a;
97
-				}
98
-				break;
99
-		}
100
-		return $output;
47
+        $output = array();
48
+        switch ($node->nodeType) {
49
+            case XML_CDATA_SECTION_NODE:
50
+                $output['@cdata'] = trim($node->textContent);
51
+                break;
52
+            case XML_TEXT_NODE:
53
+                $output = trim($node->textContent);
54
+                break;
55
+            case XML_ELEMENT_NODE:
56
+                // for each child node, call the covert function recursively
57
+                for ($i=0, $m=$node->childNodes->length; $i<$m; $i++) {
58
+                    $child = $node->childNodes->item($i);
59
+                    $v = self::convert($child);
60
+                    if(isset($child->tagName)) {
61
+                        $t = $child->tagName;
62
+                        // assume more nodes of same kind are coming
63
+                        if(!isset($output[$t])) {
64
+                            $output[$t] = array();
65
+                        }
66
+                        $output[$t][] = $v;
67
+                    } else {
68
+                        //check if it is not an empty text node
69
+                        if($v !== '') {
70
+                            $output = $v;
71
+                        }
72
+                    }
73
+                }
74
+                if(is_array($output)) {
75
+                    // if only one node of its kind, assign it directly instead if array($value);
76
+                    foreach ($output as $t => $v) {
77
+                        if(is_array($v) && count($v)==1) {
78
+                            $output[$t] = $v[0];
79
+                        }
80
+                    }
81
+                    if(empty($output)) {
82
+                        //for empty nodes
83
+                        $output = '';
84
+                    }
85
+                }
86
+                // loop through the attributes and collect them
87
+                if($node->attributes->length) {
88
+                    $a = array();
89
+                    foreach($node->attributes as $attrName => $attrNode) {
90
+                        $a[$attrName] = (string) $attrNode->value;
91
+                    }
92
+                    // if its an leaf node, store the value in @value instead of directly storing it.
93
+                    if(!is_array($output)) {
94
+                        $output = array('@value' => $output);
95
+                    }
96
+                    $output['@attributes'] = $a;
97
+                }
98
+                break;
99
+        }
100
+        return $output;
101 101
     }
102 102
     /*
103 103
      * Get the root XML node, if there isn't one, create it.
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -23,19 +23,19 @@  discard block
 block discarded – undo
23 23
      */
24 24
     public static function &createArray($input_xml) {
25 25
         $xml = self::getXMLRoot();
26
-		if(is_string($input_xml)) {
26
+		if (is_string($input_xml)) {
27 27
 			$parsed = $xml->loadXML($input_xml);
28
-			if(!$parsed) {
28
+			if (!$parsed) {
29 29
 				throw new \Exception('[XML2Array] Error parsing the XML string.');
30 30
 			}
31 31
 		} else {
32
-			if(get_class($input_xml) != 'DOMDocument') {
32
+			if (get_class($input_xml) != 'DOMDocument') {
33 33
 				throw new \Exception('[XML2Array] The input XML object should be of type: DOMDocument.');
34 34
 			}
35 35
 			$xml = self::$xml = $input_xml;
36 36
 		}
37 37
 		$array[$xml->documentElement->tagName] = self::convert($xml->documentElement);
38
-        self::$xml = null;    // clear the xml node in the class for 2nd time use.
38
+        self::$xml = null; // clear the xml node in the class for 2nd time use.
39 39
         return $array;
40 40
     }
41 41
     /**
@@ -54,43 +54,43 @@  discard block
 block discarded – undo
54 54
 				break;
55 55
 			case XML_ELEMENT_NODE:
56 56
 				// for each child node, call the covert function recursively
57
-				for ($i=0, $m=$node->childNodes->length; $i<$m; $i++) {
57
+				for ($i = 0, $m = $node->childNodes->length; $i < $m; $i++) {
58 58
 					$child = $node->childNodes->item($i);
59 59
 					$v = self::convert($child);
60
-					if(isset($child->tagName)) {
60
+					if (isset($child->tagName)) {
61 61
 						$t = $child->tagName;
62 62
 						// assume more nodes of same kind are coming
63
-						if(!isset($output[$t])) {
63
+						if (!isset($output[$t])) {
64 64
 							$output[$t] = array();
65 65
 						}
66 66
 						$output[$t][] = $v;
67 67
 					} else {
68 68
 						//check if it is not an empty text node
69
-						if($v !== '') {
69
+						if ($v !== '') {
70 70
 							$output = $v;
71 71
 						}
72 72
 					}
73 73
 				}
74
-				if(is_array($output)) {
74
+				if (is_array($output)) {
75 75
 					// if only one node of its kind, assign it directly instead if array($value);
76 76
 					foreach ($output as $t => $v) {
77
-						if(is_array($v) && count($v)==1) {
77
+						if (is_array($v) && count($v) == 1) {
78 78
 							$output[$t] = $v[0];
79 79
 						}
80 80
 					}
81
-					if(empty($output)) {
81
+					if (empty($output)) {
82 82
 						//for empty nodes
83 83
 						$output = '';
84 84
 					}
85 85
 				}
86 86
 				// loop through the attributes and collect them
87
-				if($node->attributes->length) {
87
+				if ($node->attributes->length) {
88 88
 					$a = array();
89
-					foreach($node->attributes as $attrName => $attrNode) {
89
+					foreach ($node->attributes as $attrName => $attrNode) {
90 90
 						$a[$attrName] = (string) $attrNode->value;
91 91
 					}
92 92
 					// if its an leaf node, store the value in @value instead of directly storing it.
93
-					if(!is_array($output)) {
93
+					if (!is_array($output)) {
94 94
 						$output = array('@value' => $output);
95 95
 					}
96 96
 					$output['@attributes'] = $a;
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
     /*
103 103
      * Get the root XML node, if there isn't one, create it.
104 104
      */
105
-    private static function getXMLRoot(){
106
-        if(empty(self::$xml)) {
105
+    private static function getXMLRoot() {
106
+        if (empty(self::$xml)) {
107 107
             self::init();
108 108
         }
109 109
         return self::$xml;
Please login to merge, or discard this patch.
services/NorthWind/NorthWindDSExpressionProvider.php 1 patch
Switch Indentation   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -294,103 +294,103 @@
 block discarded – undo
294 294
     public function onFunctionCallExpression($functionDescription, $params)
295 295
     {
296 296
         switch ($functionDescription->functionName) {
297
-        case ODataConstants::STRFUN_COMPARE:
298
-            return "STRCMP($params[0]; $params[1])";
299
-            break;
300
-        case ODataConstants::STRFUN_ENDSWITH:
301
-          return "(($params[1]) = RIGHT(($params[0]), LEN($params[1])))";
302
-            break;
303
-        case ODataConstants::STRFUN_INDEXOF:
304
-          // In SQLServer the index of string starts from 1, but in OData
305
-          // the string start with index 0, so the below subtraction of 1
306
-          return "(CHARINDEX($params[1], $params[0]) - 1)";
307
-            break;
308
-        case ODataConstants::STRFUN_REPLACE:
309
-          return "REPLACE($params[0], $params[1], $params[2])";
310
-            break;
311
-        case ODataConstants::STRFUN_STARTSWITH:
312
-          return "(($params[1]) = LEFT(($params[0]), LEN($params[1])))";
313
-            break;
314
-        case ODataConstants::STRFUN_TOLOWER:
315
-          return "LOWER($params[0])";
316
-            break;
317
-        case ODataConstants::STRFUN_TOUPPER:
318
-          return "UPPER($params[0])";
319
-            break;
320
-        case ODataConstants::STRFUN_TRIM:
321
-          // OData supports trim function
322
-          // We don't have the same function SQL Server, so use SQL functions LTRIM and RTRIM together
323
-          // to achieve TRIM functionality.
324
-          return "RTRIM(LTRIM($params[0]))";
325
-            break;
326
-        case ODataConstants::STRFUN_SUBSTRING:
327
-          if (count($params) == 3) {
328
-                // 3 Param version of OData substring
329
-                return "SUBSTRING($params[0], $params[1] + 1, $params[2])";
330
-            } else {
331
-                // 2 Params version of OData substring
332
-            // We don't have the same function for SQL Server, we have only:
297
+            case ODataConstants::STRFUN_COMPARE:
298
+                return "STRCMP($params[0]; $params[1])";
299
+                break;
300
+            case ODataConstants::STRFUN_ENDSWITH:
301
+              return "(($params[1]) = RIGHT(($params[0]), LEN($params[1])))";
302
+                break;
303
+            case ODataConstants::STRFUN_INDEXOF:
304
+              // In SQLServer the index of string starts from 1, but in OData
305
+              // the string start with index 0, so the below subtraction of 1
306
+              return "(CHARINDEX($params[1], $params[0]) - 1)";
307
+                break;
308
+            case ODataConstants::STRFUN_REPLACE:
309
+              return "REPLACE($params[0], $params[1], $params[2])";
310
+                break;
311
+            case ODataConstants::STRFUN_STARTSWITH:
312
+              return "(($params[1]) = LEFT(($params[0]), LEN($params[1])))";
313
+                break;
314
+            case ODataConstants::STRFUN_TOLOWER:
315
+              return "LOWER($params[0])";
316
+                break;
317
+            case ODataConstants::STRFUN_TOUPPER:
318
+              return "UPPER($params[0])";
319
+                break;
320
+            case ODataConstants::STRFUN_TRIM:
321
+              // OData supports trim function
322
+              // We don't have the same function SQL Server, so use SQL functions LTRIM and RTRIM together
323
+              // to achieve TRIM functionality.
324
+              return "RTRIM(LTRIM($params[0]))";
325
+                break;
326
+            case ODataConstants::STRFUN_SUBSTRING:
327
+              if (count($params) == 3) {
328
+                    // 3 Param version of OData substring
329
+                    return "SUBSTRING($params[0], $params[1] + 1, $params[2])";
330
+                } else {
331
+                    // 2 Params version of OData substring
332
+                // We don't have the same function for SQL Server, we have only:
333 333
 
334
-            // SUBSTRING ( value_expression , start_expression , length_expression )
335
-            // http://msdn.microsoft.com/en-us/library/ms187748.aspx
334
+                // SUBSTRING ( value_expression , start_expression , length_expression )
335
+                // http://msdn.microsoft.com/en-us/library/ms187748.aspx
336 336
 
337
-            // If the sum of start_expression and length_expression is greater than the number of characters
338
-            // in value_expression, the whole value expression beginning at start_expression is returned
339
-            // In OData substring function the index start from 0, in SQL Server its from 1
340
-            return "SUBSTRING($params[0], $params[1] + 1, LEN($params[0]))";
341
-            }
342
-            break;
343
-        case ODataConstants::STRFUN_SUBSTRINGOF:
344
-          return "(CHARINDEX($params[0], $params[1]) != 0)";
345
-            break;
346
-        case ODataConstants::STRFUN_CONCAT:
347
-            return "$params[0] + $params[1]";
348
-            break;
349
-        case ODataConstants::STRFUN_LENGTH:
350
-            return "LEN($params[0])";
351
-            break;
352
-        case ODataConstants::GUIDFUN_EQUAL:
353
-            return "($params[0] = $params[1])";
354
-            break;
355
-        case ODataConstants::DATETIME_COMPARE:
356
-            return "DATETIMECMP($params[0]; $params[1])";
357
-            break;
358
-        case ODataConstants::DATETIME_YEAR:
359
-            return "YEAR($params[0])";
360
-            break;
361
-        case ODataConstants::DATETIME_MONTH:
362
-            return "MONTH($params[0])";
363
-            break;
364
-        case ODataConstants::DATETIME_DAY:
365
-            return "DAY($params[0])";
366
-            break;
367
-        case ODataConstants::DATETIME_HOUR:
368
-            return "DATENAME(HOUR, $params[0])";
369
-            break;
370
-        case ODataConstants::DATETIME_MINUTE:
371
-            return "DATENAME(MINUTE, $params[0])";
372
-            break;
373
-        case ODataConstants::DATETIME_SECOND:
374
-            return "DATENAME(SECOND, $params[0])";
375
-            break;
376
-        case ODataConstants::MATHFUN_ROUND:
377
-            return "ROUND($params[0], $this->_default_round)";
378
-            break;
379
-        case ODataConstants::MATHFUN_CEILING:
380
-            return "CEILING($params[0])";
381
-            break;
382
-        case ODataConstants::MATHFUN_FLOOR:
383
-            return "FLOOR($params[0])";
384
-            break;
385
-        case ODataConstants::BINFUL_EQUAL:
386
-            return "($params[0] = $params[1])";
387
-            break;
337
+                // If the sum of start_expression and length_expression is greater than the number of characters
338
+                // in value_expression, the whole value expression beginning at start_expression is returned
339
+                // In OData substring function the index start from 0, in SQL Server its from 1
340
+                return "SUBSTRING($params[0], $params[1] + 1, LEN($params[0]))";
341
+                }
342
+                break;
343
+            case ODataConstants::STRFUN_SUBSTRINGOF:
344
+              return "(CHARINDEX($params[0], $params[1]) != 0)";
345
+                break;
346
+            case ODataConstants::STRFUN_CONCAT:
347
+                return "$params[0] + $params[1]";
348
+                break;
349
+            case ODataConstants::STRFUN_LENGTH:
350
+                return "LEN($params[0])";
351
+                break;
352
+            case ODataConstants::GUIDFUN_EQUAL:
353
+                return "($params[0] = $params[1])";
354
+                break;
355
+            case ODataConstants::DATETIME_COMPARE:
356
+                return "DATETIMECMP($params[0]; $params[1])";
357
+                break;
358
+            case ODataConstants::DATETIME_YEAR:
359
+                return "YEAR($params[0])";
360
+                break;
361
+            case ODataConstants::DATETIME_MONTH:
362
+                return "MONTH($params[0])";
363
+                break;
364
+            case ODataConstants::DATETIME_DAY:
365
+                return "DAY($params[0])";
366
+                break;
367
+            case ODataConstants::DATETIME_HOUR:
368
+                return "DATENAME(HOUR, $params[0])";
369
+                break;
370
+            case ODataConstants::DATETIME_MINUTE:
371
+                return "DATENAME(MINUTE, $params[0])";
372
+                break;
373
+            case ODataConstants::DATETIME_SECOND:
374
+                return "DATENAME(SECOND, $params[0])";
375
+                break;
376
+            case ODataConstants::MATHFUN_ROUND:
377
+                return "ROUND($params[0], $this->_default_round)";
378
+                break;
379
+            case ODataConstants::MATHFUN_CEILING:
380
+                return "CEILING($params[0])";
381
+                break;
382
+            case ODataConstants::MATHFUN_FLOOR:
383
+                return "FLOOR($params[0])";
384
+                break;
385
+            case ODataConstants::BINFUL_EQUAL:
386
+                return "($params[0] = $params[1])";
387
+                break;
388 388
             case 'is_null':
389 389
             return "is_null($params[0])";
390 390
             break;
391 391
 
392
-        default:
393
-            throw new \InvalidArgumentException('onFunctionCallExpression');
392
+            default:
393
+                throw new \InvalidArgumentException('onFunctionCallExpression');
394 394
         }
395 395
     }
396 396
 
Please login to merge, or discard this patch.
services/WordPress/WordPressDSExpressionProvider.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -285,22 +285,22 @@
 block discarded – undo
285 285
                 return "DATETIMECMP($params[0]; $params[1])";
286 286
                 break;
287 287
             case ODataConstants::DATETIME_YEAR:
288
-                return 'EXTRACT(YEAR from '.$params[0].')';
288
+                return 'EXTRACT(YEAR from ' . $params[0] . ')';
289 289
                 break;
290 290
             case ODataConstants::DATETIME_MONTH:
291
-                return 'EXTRACT(MONTH from '.$params[0].')';
291
+                return 'EXTRACT(MONTH from ' . $params[0] . ')';
292 292
                 break;
293 293
             case ODataConstants::DATETIME_DAY:
294
-                return 'EXTRACT(DAY from '.$params[0].')';
294
+                return 'EXTRACT(DAY from ' . $params[0] . ')';
295 295
                 break;
296 296
             case ODataConstants::DATETIME_HOUR:
297
-                return 'EXTRACT(HOUR from '.$params[0].')';
297
+                return 'EXTRACT(HOUR from ' . $params[0] . ')';
298 298
                 break;
299 299
             case ODataConstants::DATETIME_MINUTE:
300
-                return 'EXTRACT(MINUTE from '.$params[0].')';
300
+                return 'EXTRACT(MINUTE from ' . $params[0] . ')';
301 301
                 break;
302 302
             case ODataConstants::DATETIME_SECOND:
303
-                return 'EXTRACT(SECOND from '.$params[0].')';
303
+                return 'EXTRACT(SECOND from ' . $params[0] . ')';
304 304
                 break;
305 305
             case ODataConstants::MATHFUN_ROUND:
306 306
                 return "ROUND($params[0])";
Please login to merge, or discard this patch.
services/WordPress/WordPressQueryProvider.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
                 $query = 'SELECT * FROM `wp_posts` WHERE'
190 190
                         ." wp_posts.post_type = 'post'"
191 191
                         ." AND wp_posts.post_status = 'publish'"
192
-                        .' AND wp_posts.ID = '.$namedKeyValues['PostID'][0];
192
+                        .' AND wp_posts.ID = ' . $namedKeyValues['PostID'][0];
193 193
                 $stmt = mysql_query($query);
194 194
 
195 195
                 //If resource not found return null to the library
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
                         .' FROM `wp_terms` AS t INNER JOIN `wp_term_taxonomy` as tt'
206 206
                         .' ON tt.term_id = t.term_id'
207 207
                         ." WHERE tt.taxonomy = 'post_tag'"
208
-                        .' AND t.term_id = '.$namedKeyValues['TagID'][0];
208
+                        .' AND t.term_id = ' . $namedKeyValues['TagID'][0];
209 209
                 $stmt = mysql_query($query);
210 210
 
211 211
                 //If resource not found return null to the library
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
                         .' FROM `wp_terms` AS t INNER JOIN `wp_term_taxonomy` as tt'
222 222
                         .' ON tt.term_id = t.term_id'
223 223
                         ." WHERE tt.taxonomy = 'category'"
224
-                        .' AND t.term_id = '.$namedKeyValues['CategoryID'][0];
224
+                        .' AND t.term_id = ' . $namedKeyValues['CategoryID'][0];
225 225
                 $stmt = mysql_query($query);
226 226
 
227 227
                 //If resource not found return null to the library
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
             case 'Comments':
236 236
                 $query = 'SELECT * FROM `wp_comments`'
237 237
                         .' WHERE comment_approved = 1'
238
-                        .' AND comment_ID = '.$namedKeyValues['CommentID'][0];
238
+                        .' AND comment_ID = ' . $namedKeyValues['CommentID'][0];
239 239
                 $stmt = mysql_query($query);
240 240
 
241 241
                 //If resource not found return null to the library
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
                 $result = $this->_serializeComment($data);
248 248
                 break;
249 249
             case 'Users':
250
-                $query = 'SELECT * FROM `wp_users` WHERE ID = '.$namedKeyValues['UserID'][0];
250
+                $query = 'SELECT * FROM `wp_users` WHERE ID = ' . $namedKeyValues['UserID'][0];
251 251
                 $stmt = mysql_query($query);
252 252
 
253 253
                 //If resource not found return null to the library
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 
345 345
                     $result = $this->_serializeComments($stmt);
346 346
                 } else {
347
-                    die('Post does not have navigation porperty with name: '.$navigationPropName);
347
+                    die('Post does not have navigation porperty with name: ' . $navigationPropName);
348 348
                 }
349 349
                 break;
350 350
 
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 
370 370
                     $result = $this->_serializePosts($stmt);
371 371
                 } else {
372
-                    die('Tag does not have navigation porperty with name: '.$navigationPropName);
372
+                    die('Tag does not have navigation porperty with name: ' . $navigationPropName);
373 373
                 }
374 374
                 break;
375 375
 
@@ -394,12 +394,12 @@  discard block
 block discarded – undo
394 394
 
395 395
                     $result = $this->_serializePosts($stmt);
396 396
                 } else {
397
-                    die('Category does not have navigation porperty with name: '.$navigationPropName);
397
+                    die('Category does not have navigation porperty with name: ' . $navigationPropName);
398 398
                 }
399 399
                 break;
400 400
 
401 401
             case $srcClass == 'Comment':
402
-                die('Comment does not have navigation porperty with name: '.$navigationPropName);
402
+                die('Comment does not have navigation porperty with name: ' . $navigationPropName);
403 403
                 break;
404 404
 
405 405
             case $srcClass == 'User':
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 
432 432
                     $result = $this->_serializeComments($stmt);
433 433
                 } else {
434
-                    die('User does not have navigation porperty with name: '.$navigationPropName);
434
+                    die('User does not have navigation porperty with name: ' . $navigationPropName);
435 435
                 }
436 436
                 break;
437 437
         }
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
                             .' ON tr.term_taxonomy_id = tt.term_taxonomy_id'
485 485
                             ." WHERE tt.taxonomy IN ('post_tag')"
486 486
                             ." AND tr.object_id IN ($sourceEntityInstance->PostID)"
487
-                            .' AND tt.term_id = '.$namedKeyValues['TagID'][0];
487
+                            .' AND tt.term_id = ' . $namedKeyValues['TagID'][0];
488 488
                     $stmt = mysql_query($query);
489 489
                     $result = $this->_serializeTags($stmt);
490 490
                 } elseif ($navigationPropName == 'Categories') {
@@ -496,18 +496,18 @@  discard block
 block discarded – undo
496 496
                             .' ON tr.term_taxonomy_id = tt.term_taxonomy_id'
497 497
                             ." WHERE tt.taxonomy IN ('category')"
498 498
                             ." AND tr.object_id IN ($sourceEntityInstance->PostID)"
499
-                            .' AND tt.term_id = '.$namedKeyValues['CategoryID'][0];
499
+                            .' AND tt.term_id = ' . $namedKeyValues['CategoryID'][0];
500 500
                     $stmt = mysql_query($query);
501 501
                     $result = $this->_serializeCategories($stmt);
502 502
                 } elseif ($navigationPropName == 'Comments') {
503 503
                     $query = 'SELECT * FROM `wp_comments`'
504 504
                             .' WHERE comment_approved = 1'
505 505
                             ." AND comment_post_ID = $sourceEntityInstance->PostID"
506
-                            .' AND comment_ID = '.$namedKeyValues['CommentID'][0];
506
+                            .' AND comment_ID = ' . $namedKeyValues['CommentID'][0];
507 507
                     $stmt = mysql_query($query);
508 508
                     $result = $this->_serializeComments($stmt);
509 509
                 } else {
510
-                    die('Post does not have navigation porperty with name: '.$navigationPropName);
510
+                    die('Post does not have navigation porperty with name: ' . $navigationPropName);
511 511
                 }
512 512
                 break;
513 513
 
@@ -522,11 +522,11 @@  discard block
 block discarded – undo
522 522
                                 ." WHERE tt.term_id = $sourceEntityInstance->TagID"
523 523
                                 ." AND p.post_type = 'post'"
524 524
                                 ." AND p.post_status = 'publish'"
525
-                                .' AND p.ID = '.$namedKeyValues['PostID'][0];
525
+                                .' AND p.ID = ' . $namedKeyValues['PostID'][0];
526 526
                     $stmt = mysql_query($query);
527 527
                     $result = $this->_serializePosts($stmt);
528 528
                 } else {
529
-                    die('Tag does not have navigation porperty with name: '.$navigationPropName);
529
+                    die('Tag does not have navigation porperty with name: ' . $navigationPropName);
530 530
                 }
531 531
                 break;
532 532
 
@@ -541,16 +541,16 @@  discard block
 block discarded – undo
541 541
                                 ." WHERE tt.term_id = $sourceEntityInstance->CategoryID"
542 542
                                 ." AND p.post_type = 'post'"
543 543
                                 ." AND p.post_status = 'publish'"
544
-                                .' AND p.ID = '.$namedKeyValues['PostID'][0];
544
+                                .' AND p.ID = ' . $namedKeyValues['PostID'][0];
545 545
                     $stmt = mysql_query($query);
546 546
                     $result = $this->_serializePosts($stmt);
547 547
                 } else {
548
-                    die('Category does not have navigation porperty with name: '.$navigationPropName);
548
+                    die('Category does not have navigation porperty with name: ' . $navigationPropName);
549 549
                 }
550 550
                 break;
551 551
 
552 552
             case $srcClass == 'Comment':
553
-                die('Comment does not have navigation porperty with name: '.$navigationPropName);
553
+                die('Comment does not have navigation porperty with name: ' . $navigationPropName);
554 554
                 break;
555 555
 
556 556
             case $srcClass == 'User':
@@ -559,18 +559,18 @@  discard block
 block discarded – undo
559 559
                             ." wp_posts.post_type = 'post'"
560 560
                             ." AND wp_posts.post_status = 'publish'"
561 561
                             ." AND wp_posts.post_author = $sourceEntityInstance->UserID"
562
-                            .' AND wp_posts.ID = '.$namedKeyValues['PostID'][0];
562
+                            .' AND wp_posts.ID = ' . $namedKeyValues['PostID'][0];
563 563
                     $stmt = mysql_query($query);
564 564
                     $result = $this->_serializePosts($stmt);
565 565
                 } elseif ($navigationPropName == 'Comments') {
566 566
                     $query = 'SELECT * FROM `wp_comments`'
567 567
                             .' WHERE comment_approved = 1'
568 568
                             ." AND wp_comments.user_id = $sourceEntityInstance->UserID"
569
-                            .' AND wp_comments.comment_ID = '.$namedKeyValues['CommentID'][0];
569
+                            .' AND wp_comments.comment_ID = ' . $namedKeyValues['CommentID'][0];
570 570
                     $stmt = mysql_query($query);
571 571
                     $result = $this->_serializeComments($stmt);
572 572
                 } else {
573
-                    die('User does not have navigation porperty with name: '.$navigationPropName);
573
+                    die('User does not have navigation porperty with name: ' . $navigationPropName);
574 574
                 }
575 575
                 break;
576 576
         }
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
                         $result = null;
617 617
                     }
618 618
                 } else {
619
-                    die('Post does not have navigation porperty with name: '.$navigationPropName);
619
+                    die('Post does not have navigation porperty with name: ' . $navigationPropName);
620 620
                 }
621 621
                 break;
622 622
 
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
                     $data = mysql_fetch_assoc($stmt);
652 652
                     $result = $this->_serializePost($data);
653 653
                 } else {
654
-                    die('Comment does not have navigation porperty with name: '.$navigationPropName);
654
+                    die('Comment does not have navigation porperty with name: ' . $navigationPropName);
655 655
                 }
656 656
                 break;
657 657
         }
Please login to merge, or discard this patch.