@@ -187,12 +187,12 @@ discard block |
||
187 | 187 | // q: can php be built without ctype? should we use a regexp? |
188 | 188 | if (is_string($key) && !ctype_digit($key)) { |
189 | 189 | /// @todo on invalid options, throw/error-out instead of logging an error message? |
190 | - switch($key) { |
|
190 | + switch ($key) { |
|
191 | 191 | case 'target_charset': |
192 | 192 | if (function_exists('mb_convert_encoding')) { |
193 | 193 | $this->current_parsing_options['target_charset'] = $val; |
194 | 194 | } else { |
195 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ": 'target_charset' option is unsupported without mbstring"); |
|
195 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.": 'target_charset' option is unsupported without mbstring"); |
|
196 | 196 | } |
197 | 197 | break; |
198 | 198 | |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | if (is_callable($val)) { |
201 | 201 | $this->current_parsing_options['methodname_callback'] = $val; |
202 | 202 | } else { |
203 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ": Callback passed as 'methodname_callback' is not callable"); |
|
203 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.": Callback passed as 'methodname_callback' is not callable"); |
|
204 | 204 | } |
205 | 205 | break; |
206 | 206 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | break; |
212 | 212 | |
213 | 213 | default: |
214 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ": unsupported option: $key"); |
|
214 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.": unsupported option: $key"); |
|
215 | 215 | } |
216 | 216 | unset($mergedOptions[$key]); |
217 | 217 | } |
@@ -257,10 +257,10 @@ discard block |
||
257 | 257 | |
258 | 258 | try { |
259 | 259 | // @see ticket #70 - we have to parse big xml docs in chunks to avoid errors |
260 | - for ($offset = 0; $offset < $len; $offset += $this->maxChunkLength) { |
|
260 | + for ($offset = 0; $offset<$len; $offset += $this->maxChunkLength) { |
|
261 | 261 | $chunk = substr($data, $offset, $this->maxChunkLength); |
262 | 262 | // error handling: xml not well formed |
263 | - if (!xml_parse($parser, $chunk, $offset + $this->maxChunkLength >= $len)) { |
|
263 | + if (!xml_parse($parser, $chunk, $offset+$this->maxChunkLength>=$len)) { |
|
264 | 264 | $errCode = xml_get_error_code($parser); |
265 | 265 | $errStr = sprintf('XML error %s: %s at line %d, column %d', $errCode, xml_error_string($errCode), |
266 | 266 | xml_get_current_line_number($parser), xml_get_current_column_number($parser)); |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | $this->_xh['isf_reason'] = $errStr; |
270 | 270 | } |
271 | 271 | // no need to parse further if we already have a fatal error |
272 | - if ($this->_xh['isf'] >= 2) { |
|
272 | + if ($this->_xh['isf']>=2) { |
|
273 | 273 | break; |
274 | 274 | } |
275 | 275 | } |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | public function xmlrpc_se($parser, $name, $attrs, $acceptSingleVals = false) |
308 | 308 | { |
309 | 309 | // if invalid xml-rpc already detected, skip all processing |
310 | - if ($this->_xh['isf'] >= 2) { |
|
310 | + if ($this->_xh['isf']>=2) { |
|
311 | 311 | return; |
312 | 312 | } |
313 | 313 | |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | if ($acceptSingleVals === false) { |
322 | 322 | $accept = $this->current_parsing_options['accept']; |
323 | 323 | } else { |
324 | - $this->logDeprecation('Using argument $acceptSingleVals for method ' . __METHOD__ . ' is deprecated'); |
|
324 | + $this->logDeprecation('Using argument $acceptSingleVals for method '.__METHOD__.' is deprecated'); |
|
325 | 325 | $accept = self::ACCEPT_REQUEST | self::ACCEPT_RESPONSE | self::ACCEPT_VALUE; |
326 | 326 | } |
327 | 327 | if (($name == 'METHODCALL' && ($accept & self::ACCEPT_REQUEST)) || |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | $this->_xh['rt'] = strtolower($name); |
332 | 332 | } else { |
333 | 333 | $this->_xh['isf'] = 2; |
334 | - $this->_xh['isf_reason'] = 'missing top level xmlrpc element. Found: ' . $name; |
|
334 | + $this->_xh['isf_reason'] = 'missing top level xmlrpc element. Found: '.$name; |
|
335 | 335 | |
336 | 336 | return; |
337 | 337 | } |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | |
434 | 434 | case 'MEMBER': |
435 | 435 | // set member name to null, in case we do not find in the xml later on |
436 | - $this->_xh['valuestack'][count($this->_xh['valuestack']) - 1]['name'] = null; |
|
436 | + $this->_xh['valuestack'][count($this->_xh['valuestack'])-1]['name'] = null; |
|
437 | 437 | //$this->_xh['ac']=''; |
438 | 438 | // Drop trough intentionally |
439 | 439 | |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | */ |
497 | 497 | public function xmlrpc_ee($parser, $name, $rebuildXmlrpcvals = 1) |
498 | 498 | { |
499 | - if ($this->_xh['isf'] >= 2) { |
|
499 | + if ($this->_xh['isf']>=2) { |
|
500 | 500 | return; |
501 | 501 | } |
502 | 502 | |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | $this->_xh['value'] = mb_convert_encoding($this->_xh['value'], $this->current_parsing_options['target_charset'], 'UTF-8'); |
519 | 519 | } |
520 | 520 | |
521 | - if ($rebuildXmlrpcvals > 0) { |
|
521 | + if ($rebuildXmlrpcvals>0) { |
|
522 | 522 | // build the xml-rpc val out of the data received, and substitute it |
523 | 523 | $temp = new Value($this->_xh['value'], $this->_xh['vt']); |
524 | 524 | // in case we got info about underlying php class, save it in the object we're rebuilding |
@@ -526,15 +526,15 @@ discard block |
||
526 | 526 | $temp->_php_class = $this->_xh['php_class']; |
527 | 527 | } |
528 | 528 | $this->_xh['value'] = $temp; |
529 | - } elseif ($rebuildXmlrpcvals < 0) { |
|
529 | + } elseif ($rebuildXmlrpcvals<0) { |
|
530 | 530 | if ($this->_xh['vt'] == Value::$xmlrpcDateTime) { |
531 | - $this->_xh['value'] = (object)array( |
|
531 | + $this->_xh['value'] = (object) array( |
|
532 | 532 | 'xmlrpc_type' => 'datetime', |
533 | 533 | 'scalar' => $this->_xh['value'], |
534 | 534 | 'timestamp' => \PhpXmlRpc\Helper\Date::iso8601Decode($this->_xh['value']) |
535 | 535 | ); |
536 | 536 | } elseif ($this->_xh['vt'] == Value::$xmlrpcBase64) { |
537 | - $this->_xh['value'] = (object)array( |
|
537 | + $this->_xh['value'] = (object) array( |
|
538 | 538 | 'xmlrpc_type' => 'base64', |
539 | 539 | 'scalar' => $this->_xh['value'] |
540 | 540 | ); |
@@ -549,8 +549,8 @@ discard block |
||
549 | 549 | // check if we are inside an array or struct: |
550 | 550 | // if value just built is inside an array, let's move it into array on the stack |
551 | 551 | $vscount = count($this->_xh['valuestack']); |
552 | - if ($vscount && $this->_xh['valuestack'][$vscount - 1]['type'] == 'ARRAY') { |
|
553 | - $this->_xh['valuestack'][$vscount - 1]['values'][] = $this->_xh['value']; |
|
552 | + if ($vscount && $this->_xh['valuestack'][$vscount-1]['type'] == 'ARRAY') { |
|
553 | + $this->_xh['valuestack'][$vscount-1]['values'][] = $this->_xh['value']; |
|
554 | 554 | } |
555 | 555 | break; |
556 | 556 | |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | // log if receiving something strange, even though we set the value to false anyway |
578 | 578 | /// @todo to be consistent with the other types, we should return a value outside the good-value domain, e.g. NULL |
579 | 579 | if ($this->_xh['ac'] != '0' && strcasecmp($this->_xh['ac'], 'false') !== 0) { |
580 | - if (!$this->handleParsingError('invalid data received in BOOLEAN value: ' . |
|
580 | + if (!$this->handleParsingError('invalid data received in BOOLEAN value: '. |
|
581 | 581 | $this->truncateValueForLog($this->_xh['ac']), __METHOD__)) { |
582 | 582 | return; |
583 | 583 | } |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | $this->_xh['vt'] = strtolower($name); |
598 | 598 | $this->_xh['lv'] = 3; // indicate we've found a value |
599 | 599 | if (!preg_match(PhpXmlRpc::$xmlrpc_int_format, $this->_xh['ac'])) { |
600 | - if (!$this->handleParsingError('non numeric data received in INT value: ' . |
|
600 | + if (!$this->handleParsingError('non numeric data received in INT value: '. |
|
601 | 601 | $this->truncateValueForLog($this->_xh['ac']), __METHOD__)) { |
602 | 602 | return; |
603 | 603 | } |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | $this->_xh['value'] = 'ERROR_NON_NUMERIC_FOUND'; |
606 | 606 | } else { |
607 | 607 | // it's ok, add it on |
608 | - $this->_xh['value'] = (int)$this->_xh['ac']; |
|
608 | + $this->_xh['value'] = (int) $this->_xh['ac']; |
|
609 | 609 | } |
610 | 610 | break; |
611 | 611 | |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | $this->_xh['vt'] = Value::$xmlrpcDouble; |
614 | 614 | $this->_xh['lv'] = 3; // indicate we've found a value |
615 | 615 | if (!preg_match(PhpXmlRpc::$xmlrpc_double_format, $this->_xh['ac'])) { |
616 | - if (!$this->handleParsingError('non numeric data received in DOUBLE value: ' . |
|
616 | + if (!$this->handleParsingError('non numeric data received in DOUBLE value: '. |
|
617 | 617 | $this->truncateValueForLog($this->_xh['ac']), __METHOD__)) { |
618 | 618 | return; |
619 | 619 | } |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | $this->_xh['value'] = 'ERROR_NON_NUMERIC_FOUND'; |
622 | 622 | } else { |
623 | 623 | // it's ok, add it on |
624 | - $this->_xh['value'] = (double)$this->_xh['ac']; |
|
624 | + $this->_xh['value'] = (double) $this->_xh['ac']; |
|
625 | 625 | } |
626 | 626 | break; |
627 | 627 | |
@@ -629,7 +629,7 @@ discard block |
||
629 | 629 | $this->_xh['vt'] = Value::$xmlrpcDateTime; |
630 | 630 | $this->_xh['lv'] = 3; // indicate we've found a value |
631 | 631 | if (!preg_match(PhpXmlRpc::$xmlrpc_datetime_format, $this->_xh['ac'])) { |
632 | - if (!$this->handleParsingError('invalid data received in DATETIME value: ' . |
|
632 | + if (!$this->handleParsingError('invalid data received in DATETIME value: '. |
|
633 | 633 | $this->truncateValueForLog($this->_xh['ac']), __METHOD__)) { |
634 | 634 | return; |
635 | 635 | } |
@@ -640,9 +640,9 @@ discard block |
||
640 | 640 | |
641 | 641 | // the default regex used to validate the date string a few lines above should make this case impossible, |
642 | 642 | // but one never knows... |
643 | - } catch(\Exception $e) { |
|
643 | + } catch (\Exception $e) { |
|
644 | 644 | // what to do? We can not guarantee that a valid date can be created. We return null... |
645 | - if (!$this->handleParsingError('invalid data received in DATETIME value. Error ' . |
|
645 | + if (!$this->handleParsingError('invalid data received in DATETIME value. Error '. |
|
646 | 646 | $e->getMessage(), __METHOD__)) { |
647 | 647 | return; |
648 | 648 | } |
@@ -659,14 +659,14 @@ discard block |
||
659 | 659 | $v = base64_decode($this->_xh['ac'], true); |
660 | 660 | if ($v === false) { |
661 | 661 | $this->_xh['isf'] = 2; |
662 | - $this->_xh['isf_reason'] = 'Invalid data received in BASE64 value: '. $this->truncateValueForLog($this->_xh['ac']); |
|
662 | + $this->_xh['isf_reason'] = 'Invalid data received in BASE64 value: '.$this->truncateValueForLog($this->_xh['ac']); |
|
663 | 663 | return; |
664 | 664 | } |
665 | 665 | } else { |
666 | 666 | $v = base64_decode($this->_xh['ac']); |
667 | 667 | if ($v === '' && $this->_xh['ac'] !== '') { |
668 | 668 | // only the empty string should decode to the empty string |
669 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': invalid data received in BASE64 value: ' . |
|
669 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': invalid data received in BASE64 value: '. |
|
670 | 670 | $this->truncateValueForLog($this->_xh['ac'])); |
671 | 671 | } |
672 | 672 | } |
@@ -674,20 +674,20 @@ discard block |
||
674 | 674 | break; |
675 | 675 | |
676 | 676 | case 'NAME': |
677 | - $this->_xh['valuestack'][count($this->_xh['valuestack']) - 1]['name'] = $this->_xh['ac']; |
|
677 | + $this->_xh['valuestack'][count($this->_xh['valuestack'])-1]['name'] = $this->_xh['ac']; |
|
678 | 678 | break; |
679 | 679 | |
680 | 680 | case 'MEMBER': |
681 | 681 | // add to array in the stack the last element built, unless no VALUE or no NAME were found |
682 | 682 | if ($this->_xh['vt']) { |
683 | 683 | $vscount = count($this->_xh['valuestack']); |
684 | - if ($this->_xh['valuestack'][$vscount - 1]['name'] === null) { |
|
684 | + if ($this->_xh['valuestack'][$vscount-1]['name'] === null) { |
|
685 | 685 | if (!$this->handleParsingError('missing NAME inside STRUCT in received xml', __METHOD__)) { |
686 | 686 | return; |
687 | 687 | } |
688 | - $this->_xh['valuestack'][$vscount - 1]['name'] = ''; |
|
688 | + $this->_xh['valuestack'][$vscount-1]['name'] = ''; |
|
689 | 689 | } |
690 | - $this->_xh['valuestack'][$vscount - 1]['values'][$this->_xh['valuestack'][$vscount - 1]['name']] = $this->_xh['value']; |
|
690 | + $this->_xh['valuestack'][$vscount-1]['values'][$this->_xh['valuestack'][$vscount-1]['name']] = $this->_xh['value']; |
|
691 | 691 | } else { |
692 | 692 | if (!$this->handleParsingError('missing VALUE inside STRUCT in received xml', __METHOD__)) { |
693 | 693 | return; |
@@ -803,7 +803,7 @@ discard block |
||
803 | 803 | public function xmlrpc_cd($parser, $data) |
804 | 804 | { |
805 | 805 | // skip processing if xml fault already detected |
806 | - if ($this->_xh['isf'] >= 2) { |
|
806 | + if ($this->_xh['isf']>=2) { |
|
807 | 807 | return; |
808 | 808 | } |
809 | 809 | |
@@ -825,7 +825,7 @@ discard block |
||
825 | 825 | public function xmlrpc_dh($parser, $data) |
826 | 826 | { |
827 | 827 | // skip processing if xml fault already detected |
828 | - if ($this->_xh['isf'] >= 2) { |
|
828 | + if ($this->_xh['isf']>=2) { |
|
829 | 829 | return; |
830 | 830 | } |
831 | 831 | |
@@ -901,8 +901,8 @@ discard block |
||
901 | 901 | // Details: |
902 | 902 | // SPACE: (#x20 | #x9 | #xD | #xA)+ === [ \x9\xD\xA]+ |
903 | 903 | // EQ: SPACE?=SPACE? === [ \x9\xD\xA]*=[ \x9\xD\xA]* |
904 | - if (preg_match('/^<\?xml\s+version\s*=\s*' . "((?:\"[a-zA-Z0-9_.:-]+\")|(?:'[a-zA-Z0-9_.:-]+'))" . |
|
905 | - '\s+encoding\s*=\s*' . "((?:\"[A-Za-z][A-Za-z0-9._-]*\")|(?:'[A-Za-z][A-Za-z0-9._-]*'))/", |
|
904 | + if (preg_match('/^<\?xml\s+version\s*=\s*'."((?:\"[a-zA-Z0-9_.:-]+\")|(?:'[a-zA-Z0-9_.:-]+'))". |
|
905 | + '\s+encoding\s*=\s*'."((?:\"[A-Za-z][A-Za-z0-9._-]*\")|(?:'[A-Za-z][A-Za-z0-9._-]*'))/", |
|
906 | 906 | $xmlChunk, $matches)) { |
907 | 907 | return strtoupper(substr($matches[2], 1, -1)); |
908 | 908 | } |
@@ -920,7 +920,7 @@ discard block |
||
920 | 920 | // NB: mb_detect likes to call it ascii, xml parser likes to call it US_ASCII... |
921 | 921 | // IANA also likes better US-ASCII, so go with it |
922 | 922 | if ($enc == 'ASCII') { |
923 | - $enc = 'US-' . $enc; |
|
923 | + $enc = 'US-'.$enc; |
|
924 | 924 | } |
925 | 925 | |
926 | 926 | return $enc; |
@@ -957,8 +957,8 @@ discard block |
||
957 | 957 | // Details: |
958 | 958 | // SPACE: (#x20 | #x9 | #xD | #xA)+ === [ \x9\xD\xA]+ |
959 | 959 | // EQ: SPACE?=SPACE? === [ \x9\xD\xA]*=[ \x9\xD\xA]* |
960 | - if (preg_match('/^<\?xml\s+version\s*=\s*' . "((?:\"[a-zA-Z0-9_.:-]+\")|(?:'[a-zA-Z0-9_.:-]+'))" . |
|
961 | - '\s+encoding\s*=\s*' . "((?:\"[A-Za-z][A-Za-z0-9._-]*\")|(?:'[A-Za-z][A-Za-z0-9._-]*'))/", |
|
960 | + if (preg_match('/^<\?xml\s+version\s*=\s*'."((?:\"[a-zA-Z0-9_.:-]+\")|(?:'[a-zA-Z0-9_.:-]+'))". |
|
961 | + '\s+encoding\s*=\s*'."((?:\"[A-Za-z][A-Za-z0-9._-]*\")|(?:'[A-Za-z][A-Za-z0-9._-]*'))/", |
|
962 | 962 | $xmlChunk)) { |
963 | 963 | return true; |
964 | 964 | } |
@@ -978,7 +978,7 @@ discard block |
||
978 | 978 | $this->_xh['isf_reason'] = ucfirst($message); |
979 | 979 | return false; |
980 | 980 | } else { |
981 | - $this->getLogger()->error('XML-RPC: ' . ($method != '' ? $method . ': ' : '') . $message); |
|
981 | + $this->getLogger()->error('XML-RPC: '.($method != '' ? $method.': ' : '').$message); |
|
982 | 982 | return true; |
983 | 983 | } |
984 | 984 | } |
@@ -990,8 +990,8 @@ discard block |
||
990 | 990 | */ |
991 | 991 | protected function truncateValueForLog($data) |
992 | 992 | { |
993 | - if (strlen($data) > $this->maxLogValueLength) { |
|
994 | - return substr($data, 0, $this->maxLogValueLength - 3) . '...'; |
|
993 | + if (strlen($data)>$this->maxLogValueLength) { |
|
994 | + return substr($data, 0, $this->maxLogValueLength-3).'...'; |
|
995 | 995 | } |
996 | 996 | |
997 | 997 | return $data; |
@@ -1012,7 +1012,7 @@ discard block |
||
1012 | 1012 | public function xmlrpc_se_any($parser, $name, $attrs) |
1013 | 1013 | { |
1014 | 1014 | // this will be spamming the log if this method is in use... |
1015 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
1015 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
1016 | 1016 | |
1017 | 1017 | $this->xmlrpc_se($parser, $name, $attrs, true); |
1018 | 1018 | } |
@@ -1021,12 +1021,12 @@ discard block |
||
1021 | 1021 | { |
1022 | 1022 | switch ($name) { |
1023 | 1023 | case 'xmlrpc_valid_parents': |
1024 | - $this->logDeprecation('Getting property XMLParser::' . $name . ' is deprecated'); |
|
1024 | + $this->logDeprecation('Getting property XMLParser::'.$name.' is deprecated'); |
|
1025 | 1025 | return $this->$name; |
1026 | 1026 | default: |
1027 | 1027 | /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout... |
1028 | 1028 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); |
1029 | - trigger_error('Undefined property via __get(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); |
|
1029 | + trigger_error('Undefined property via __get(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); |
|
1030 | 1030 | $result = null; |
1031 | 1031 | return $result; |
1032 | 1032 | } |
@@ -1037,17 +1037,17 @@ discard block |
||
1037 | 1037 | switch ($name) { |
1038 | 1038 | // this should only ever be called by subclasses which overtook `parse()` |
1039 | 1039 | case 'accept': |
1040 | - $this->logDeprecation('Setting property XMLParser::' . $name . ' is deprecated'); |
|
1040 | + $this->logDeprecation('Setting property XMLParser::'.$name.' is deprecated'); |
|
1041 | 1041 | $this->current_parsing_options['accept'] = $value; |
1042 | 1042 | break; |
1043 | 1043 | case 'xmlrpc_valid_parents': |
1044 | - $this->logDeprecation('Setting property XMLParser::' . $name . ' is deprecated'); |
|
1044 | + $this->logDeprecation('Setting property XMLParser::'.$name.' is deprecated'); |
|
1045 | 1045 | $this->$name = $value; |
1046 | 1046 | break; |
1047 | 1047 | default: |
1048 | 1048 | /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout... |
1049 | 1049 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); |
1050 | - trigger_error('Undefined property via __set(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); |
|
1050 | + trigger_error('Undefined property via __set(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); |
|
1051 | 1051 | } |
1052 | 1052 | } |
1053 | 1053 | |
@@ -1055,10 +1055,10 @@ discard block |
||
1055 | 1055 | { |
1056 | 1056 | switch ($name) { |
1057 | 1057 | case 'accept': |
1058 | - $this->logDeprecation('Checking property XMLParser::' . $name . ' is deprecated'); |
|
1058 | + $this->logDeprecation('Checking property XMLParser::'.$name.' is deprecated'); |
|
1059 | 1059 | return isset($this->current_parsing_options['accept']); |
1060 | 1060 | case 'xmlrpc_valid_parents': |
1061 | - $this->logDeprecation('Checking property XMLParser::' . $name . ' is deprecated'); |
|
1061 | + $this->logDeprecation('Checking property XMLParser::'.$name.' is deprecated'); |
|
1062 | 1062 | return isset($this->$name); |
1063 | 1063 | default: |
1064 | 1064 | return false; |
@@ -1070,17 +1070,17 @@ discard block |
||
1070 | 1070 | switch ($name) { |
1071 | 1071 | // q: does this make sense at all? |
1072 | 1072 | case 'accept': |
1073 | - $this->logDeprecation('Unsetting property XMLParser::' . $name . ' is deprecated'); |
|
1073 | + $this->logDeprecation('Unsetting property XMLParser::'.$name.' is deprecated'); |
|
1074 | 1074 | unset($this->current_parsing_options['accept']); |
1075 | 1075 | break; |
1076 | 1076 | case 'xmlrpc_valid_parents': |
1077 | - $this->logDeprecation('Unsetting property XMLParser::' . $name . ' is deprecated'); |
|
1077 | + $this->logDeprecation('Unsetting property XMLParser::'.$name.' is deprecated'); |
|
1078 | 1078 | unset($this->$name); |
1079 | 1079 | break; |
1080 | 1080 | default: |
1081 | 1081 | /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout... |
1082 | 1082 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); |
1083 | - trigger_error('Undefined property via __unset(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); |
|
1083 | + trigger_error('Undefined property via __unset(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); |
|
1084 | 1084 | } |
1085 | 1085 | } |
1086 | 1086 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $this->me['struct'] = $val; |
99 | 99 | break; |
100 | 100 | default: |
101 | - $this->getLogger()->error("XML-RPC: " . __METHOD__ . ": not a known type ($type)"); |
|
101 | + $this->getLogger()->error("XML-RPC: ".__METHOD__.": not a known type ($type)"); |
|
102 | 102 | } |
103 | 103 | } |
104 | 104 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | |
130 | 130 | if ($typeOf !== 1) { |
131 | - $this->getLogger()->error("XML-RPC: " . __METHOD__ . ": not a scalar type ($type)"); |
|
131 | + $this->getLogger()->error("XML-RPC: ".__METHOD__.": not a scalar type ($type)"); |
|
132 | 132 | return 0; |
133 | 133 | } |
134 | 134 | |
@@ -145,10 +145,10 @@ discard block |
||
145 | 145 | |
146 | 146 | switch ($this->mytype) { |
147 | 147 | case 1: |
148 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': scalar xmlrpc value can have only one value'); |
|
148 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': scalar xmlrpc value can have only one value'); |
|
149 | 149 | return 0; |
150 | 150 | case 3: |
151 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': cannot add anonymous scalar to struct xmlrpc value'); |
|
151 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': cannot add anonymous scalar to struct xmlrpc value'); |
|
152 | 152 | return 0; |
153 | 153 | case 2: |
154 | 154 | // we're adding a scalar value to an array here |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | |
193 | 193 | return 1; |
194 | 194 | } else { |
195 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': already initialized as a [' . $this->kindOf() . ']'); |
|
195 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': already initialized as a ['.$this->kindOf().']'); |
|
196 | 196 | return 0; |
197 | 197 | } |
198 | 198 | } |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | |
224 | 224 | return 1; |
225 | 225 | } else { |
226 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': already initialized as a [' . $this->kindOf() . ']'); |
|
226 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': already initialized as a ['.$this->kindOf().']'); |
|
227 | 227 | return 0; |
228 | 228 | } |
229 | 229 | } |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | $val = reset($this->me); |
289 | 289 | $typ = key($this->me); |
290 | 290 | |
291 | - return '<value>' . $this->serializeData($typ, $val, $charsetEncoding) . "</value>\n"; |
|
291 | + return '<value>'.$this->serializeData($typ, $val, $charsetEncoding)."</value>\n"; |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | /** |
@@ -311,19 +311,19 @@ discard block |
||
311 | 311 | case 1: |
312 | 312 | switch ($typ) { |
313 | 313 | case static::$xmlrpcBase64: |
314 | - $rs = "<{$typ}>" . base64_encode($val) . "</{$typ}>"; |
|
314 | + $rs = "<{$typ}>".base64_encode($val)."</{$typ}>"; |
|
315 | 315 | break; |
316 | 316 | case static::$xmlrpcBoolean: |
317 | - $rs = "<{$typ}>" . ($val ? '1' : '0') . "</{$typ}>"; |
|
317 | + $rs = "<{$typ}>".($val ? '1' : '0')."</{$typ}>"; |
|
318 | 318 | break; |
319 | 319 | case static::$xmlrpcString: |
320 | 320 | // Do NOT use htmlentities, since it will produce named html entities, which are invalid xml |
321 | - $rs = "<{$typ}>" . $this->getCharsetEncoder()->encodeEntities($val, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</{$typ}>"; |
|
321 | + $rs = "<{$typ}>".$this->getCharsetEncoder()->encodeEntities($val, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</{$typ}>"; |
|
322 | 322 | break; |
323 | 323 | case static::$xmlrpcInt: |
324 | 324 | case static::$xmlrpcI4: |
325 | 325 | case static::$xmlrpcI8: |
326 | - $rs = "<{$typ}>" . (int)$val . "</{$typ}>"; |
|
326 | + $rs = "<{$typ}>".(int) $val."</{$typ}>"; |
|
327 | 327 | break; |
328 | 328 | case static::$xmlrpcDouble: |
329 | 329 | // avoid using standard conversion of float to string because it is locale-dependent, |
@@ -331,16 +331,16 @@ discard block |
||
331 | 331 | // sprintf('%F') could be most likely ok, but it fails e.g. on 2e-14. |
332 | 332 | // The code below tries its best at keeping max precision while avoiding exp notation, |
333 | 333 | // but there is of course no limit in the number of decimal places to be used... |
334 | - $rs = "<{$typ}>" . preg_replace('/\\.?0+$/', '', number_format((double)$val, PhpXmlRpc::$xmlpc_double_precision, '.', '')) . "</{$typ}>"; |
|
334 | + $rs = "<{$typ}>".preg_replace('/\\.?0+$/', '', number_format((double) $val, PhpXmlRpc::$xmlpc_double_precision, '.', ''))."</{$typ}>"; |
|
335 | 335 | break; |
336 | 336 | case static::$xmlrpcDateTime: |
337 | 337 | if (is_string($val)) { |
338 | 338 | $rs = "<{$typ}>{$val}</{$typ}>"; |
339 | 339 | // DateTimeInterface is not present in php 5.4... |
340 | 340 | } elseif (is_a($val, 'DateTimeInterface') || is_a($val, 'DateTime')) { |
341 | - $rs = "<{$typ}>" . $val->format('Ymd\TH:i:s') . "</{$typ}>"; |
|
341 | + $rs = "<{$typ}>".$val->format('Ymd\TH:i:s')."</{$typ}>"; |
|
342 | 342 | } elseif (is_int($val)) { |
343 | - $rs = "<{$typ}>" . date('Ymd\TH:i:s', $val) . "</{$typ}>"; |
|
343 | + $rs = "<{$typ}>".date('Ymd\TH:i:s', $val)."</{$typ}>"; |
|
344 | 344 | } else { |
345 | 345 | // not really a good idea here: but what should we output anyway? left for backward compat... |
346 | 346 | $rs = "<{$typ}>{$val}</{$typ}>"; |
@@ -362,14 +362,14 @@ discard block |
||
362 | 362 | case 3: |
363 | 363 | // struct |
364 | 364 | if ($this->_php_class) { |
365 | - $rs = '<struct php_class="' . $this->_php_class . "\">\n"; |
|
365 | + $rs = '<struct php_class="'.$this->_php_class."\">\n"; |
|
366 | 366 | } else { |
367 | 367 | $rs = "<struct>\n"; |
368 | 368 | } |
369 | 369 | $charsetEncoder = $this->getCharsetEncoder(); |
370 | 370 | /** @var Value $val2 */ |
371 | 371 | foreach ($val as $key2 => $val2) { |
372 | - $rs .= '<member><name>' . $charsetEncoder->encodeEntities($key2, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</name>\n"; |
|
372 | + $rs .= '<member><name>'.$charsetEncoder->encodeEntities($key2, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</name>\n"; |
|
373 | 373 | $rs .= $val2->serialize($charsetEncoding); |
374 | 374 | $rs .= "</member>\n"; |
375 | 375 | } |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | */ |
584 | 584 | public function structMemExists($key) |
585 | 585 | { |
586 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
586 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
587 | 587 | |
588 | 588 | return array_key_exists($key, $this->me['struct']); |
589 | 589 | } |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | */ |
600 | 600 | public function structMem($key) |
601 | 601 | { |
602 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
602 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
603 | 603 | |
604 | 604 | return $this->me['struct'][$key]; |
605 | 605 | } |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | */ |
613 | 613 | public function structReset() |
614 | 614 | { |
615 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
615 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
616 | 616 | |
617 | 617 | reset($this->me['struct']); |
618 | 618 | } |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | */ |
627 | 627 | public function structEach() |
628 | 628 | { |
629 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
629 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
630 | 630 | |
631 | 631 | $key = key($this->me['struct']); |
632 | 632 | $value = current($this->me['struct']); |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | */ |
646 | 646 | public function arrayMem($key) |
647 | 647 | { |
648 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
648 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
649 | 649 | |
650 | 650 | return $this->me['array'][$key]; |
651 | 651 | } |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | */ |
660 | 660 | public function arraySize() |
661 | 661 | { |
662 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
662 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
663 | 663 | |
664 | 664 | return count($this->me['array']); |
665 | 665 | } |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | */ |
674 | 674 | public function structSize() |
675 | 675 | { |
676 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
676 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
677 | 677 | |
678 | 678 | return count($this->me['struct']); |
679 | 679 | } |
@@ -685,12 +685,12 @@ discard block |
||
685 | 685 | case 'me': |
686 | 686 | case 'mytype': |
687 | 687 | case '_php_class': |
688 | - $this->logDeprecation('Getting property Value::' . $name . ' is deprecated'); |
|
688 | + $this->logDeprecation('Getting property Value::'.$name.' is deprecated'); |
|
689 | 689 | return $this->$name; |
690 | 690 | default: |
691 | 691 | /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout... |
692 | 692 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); |
693 | - trigger_error('Undefined property via __get(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); |
|
693 | + trigger_error('Undefined property via __get(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); |
|
694 | 694 | $result = null; |
695 | 695 | return $result; |
696 | 696 | } |
@@ -702,13 +702,13 @@ discard block |
||
702 | 702 | case 'me': |
703 | 703 | case 'mytype': |
704 | 704 | case '_php_class': |
705 | - $this->logDeprecation('Setting property Value::' . $name . ' is deprecated'); |
|
705 | + $this->logDeprecation('Setting property Value::'.$name.' is deprecated'); |
|
706 | 706 | $this->$name = $value; |
707 | 707 | break; |
708 | 708 | default: |
709 | 709 | /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout... |
710 | 710 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); |
711 | - trigger_error('Undefined property via __set(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); |
|
711 | + trigger_error('Undefined property via __set(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); |
|
712 | 712 | } |
713 | 713 | } |
714 | 714 | |
@@ -718,7 +718,7 @@ discard block |
||
718 | 718 | case 'me': |
719 | 719 | case 'mytype': |
720 | 720 | case '_php_class': |
721 | - $this->logDeprecation('Checking property Value::' . $name . ' is deprecated'); |
|
721 | + $this->logDeprecation('Checking property Value::'.$name.' is deprecated'); |
|
722 | 722 | return isset($this->$name); |
723 | 723 | default: |
724 | 724 | return false; |
@@ -731,13 +731,13 @@ discard block |
||
731 | 731 | case 'me': |
732 | 732 | case 'mytype': |
733 | 733 | case '_php_class': |
734 | - $this->logDeprecation('Unsetting property Value::' . $name . ' is deprecated'); |
|
734 | + $this->logDeprecation('Unsetting property Value::'.$name.' is deprecated'); |
|
735 | 735 | unset($this->$name); |
736 | 736 | break; |
737 | 737 | default: |
738 | 738 | /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout... |
739 | 739 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); |
740 | - trigger_error('Undefined property via __unset(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); |
|
740 | + trigger_error('Undefined property via __unset(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); |
|
741 | 741 | } |
742 | 742 | } |
743 | 743 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | return true; |
86 | 86 | } else { |
87 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': value passed in must be a PhpXmlRpc\Value'); |
|
87 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': value passed in must be a PhpXmlRpc\Value'); |
|
88 | 88 | return false; |
89 | 89 | } |
90 | 90 | } |
@@ -134,17 +134,17 @@ discard block |
||
134 | 134 | $this->logDeprecationUnlessCalledBy('serialize'); |
135 | 135 | |
136 | 136 | if ($charsetEncoding != '') { |
137 | - $this->content_type = 'text/xml; charset=' . $charsetEncoding; |
|
137 | + $this->content_type = 'text/xml; charset='.$charsetEncoding; |
|
138 | 138 | } else { |
139 | 139 | $this->content_type = 'text/xml'; |
140 | 140 | } |
141 | 141 | |
142 | 142 | $result = $this->xml_header($charsetEncoding); |
143 | - $result .= '<methodName>' . $this->getCharsetEncoder()->encodeEntities( |
|
144 | - $this->methodname, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</methodName>\n"; |
|
143 | + $result .= '<methodName>'.$this->getCharsetEncoder()->encodeEntities( |
|
144 | + $this->methodname, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</methodName>\n"; |
|
145 | 145 | $result .= "<params>\n"; |
146 | 146 | foreach ($this->params as $p) { |
147 | - $result .= "<param>\n" . $p->serialize($charsetEncoding) . |
|
147 | + $result .= "<param>\n".$p->serialize($charsetEncoding). |
|
148 | 148 | "</param>\n"; |
149 | 149 | } |
150 | 150 | $result .= "</params>\n"; |
@@ -164,9 +164,9 @@ discard block |
||
164 | 164 | $this->logDeprecationUnlessCalledBy('createPayload'); |
165 | 165 | |
166 | 166 | if ($charsetEncoding != '') { |
167 | - return "<?xml version=\"1.0\" encoding=\"$charsetEncoding\" ?" . ">\n<methodCall>\n"; |
|
167 | + return "<?xml version=\"1.0\" encoding=\"$charsetEncoding\" ?".">\n<methodCall>\n"; |
|
168 | 168 | } else { |
169 | - return "<?xml version=\"1.0\"?" . ">\n<methodCall>\n"; |
|
169 | + return "<?xml version=\"1.0\"?".">\n<methodCall>\n"; |
|
170 | 170 | } |
171 | 171 | } |
172 | 172 | |
@@ -228,14 +228,14 @@ discard block |
||
228 | 228 | */ |
229 | 229 | public function parseResponse($data = '', $headersProcessed = false, $returnType = XMLParser::RETURN_XMLRPCVALS) |
230 | 230 | { |
231 | - if ($this->debug > 0) { |
|
231 | + if ($this->debug>0) { |
|
232 | 232 | $this->getLogger()->debug("---GOT---\n$data\n---END---"); |
233 | 233 | } |
234 | 234 | |
235 | 235 | $this->httpResponse = array('raw_data' => $data, 'headers' => array(), 'cookies' => array()); |
236 | 236 | |
237 | 237 | if ($data == '') { |
238 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': no response received from server.'); |
|
238 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': no response received from server.'); |
|
239 | 239 | return new Response(0, PhpXmlRpc::$xmlrpcerr['no_data'], PhpXmlRpc::$xmlrpcstr['no_data']); |
240 | 240 | } |
241 | 241 | |
@@ -243,12 +243,12 @@ discard block |
||
243 | 243 | if (substr($data, 0, 4) == 'HTTP') { |
244 | 244 | $httpParser = new Http(); |
245 | 245 | try { |
246 | - $httpResponse = $httpParser->parseResponseHeaders($data, $headersProcessed, $this->debug > 0); |
|
246 | + $httpResponse = $httpParser->parseResponseHeaders($data, $headersProcessed, $this->debug>0); |
|
247 | 247 | } catch (HttpException $e) { |
248 | 248 | // failed processing of HTTP response headers |
249 | 249 | // save into response obj the full payload received, for debugging |
250 | 250 | return new Response(0, $e->getCode(), $e->getMessage(), '', array('raw_data' => $data, 'status_code', $e->statusCode())); |
251 | - } catch(\Exception $e) { |
|
251 | + } catch (\Exception $e) { |
|
252 | 252 | return new Response(0, $e->getCode(), $e->getMessage(), '', array('raw_data' => $data)); |
253 | 253 | } |
254 | 254 | } else { |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | // idea from Luca Mariano <[email protected]> originally in PEARified version of the lib |
265 | 265 | $pos = strrpos($data, '</methodResponse>'); |
266 | 266 | if ($pos !== false) { |
267 | - $data = substr($data, 0, $pos + 17); |
|
267 | + $data = substr($data, 0, $pos+17); |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | // try to 'guestimate' the character encoding of the received response |
@@ -273,21 +273,21 @@ discard block |
||
273 | 273 | $data |
274 | 274 | ); |
275 | 275 | |
276 | - if ($this->debug >= 0) { |
|
276 | + if ($this->debug>=0) { |
|
277 | 277 | $this->httpResponse = $httpResponse; |
278 | 278 | } else { |
279 | 279 | $httpResponse = null; |
280 | 280 | } |
281 | 281 | |
282 | - if ($this->debug > 0) { |
|
282 | + if ($this->debug>0) { |
|
283 | 283 | $start = strpos($data, '<!-- SERVER DEBUG INFO (BASE64 ENCODED):'); |
284 | 284 | if ($start) { |
285 | 285 | $start += strlen('<!-- SERVER DEBUG INFO (BASE64 ENCODED):'); |
286 | 286 | /// @todo what if there is no end tag? |
287 | 287 | $end = strpos($data, '-->', $start); |
288 | - $comments = substr($data, $start, $end - $start); |
|
289 | - $this->getLogger()->debug("---SERVER DEBUG INFO (DECODED)---\n\t" . |
|
290 | - str_replace("\n", "\n\t", base64_decode($comments)) . "\n---END---", array('encoding' => $respEncoding)); |
|
288 | + $comments = substr($data, $start, $end-$start); |
|
289 | + $this->getLogger()->debug("---SERVER DEBUG INFO (DECODED)---\n\t". |
|
290 | + str_replace("\n", "\n\t", base64_decode($comments))."\n---END---", array('encoding' => $respEncoding)); |
|
291 | 291 | } |
292 | 292 | } |
293 | 293 | |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | if ($respEncoding == 'ISO-8859-1') { |
310 | 310 | $data = utf8_encode($data); |
311 | 311 | } else { |
312 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': unsupported charset encoding of received response: ' . $respEncoding); |
|
312 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': unsupported charset encoding of received response: '.$respEncoding); |
|
313 | 313 | } |
314 | 314 | } |
315 | 315 | } |
@@ -336,16 +336,16 @@ discard block |
||
336 | 336 | // there could be proxies meddling with the request, or network data corruption... |
337 | 337 | |
338 | 338 | $r = new Response(0, PhpXmlRpc::$xmlrpcerr['invalid_xml'], |
339 | - PhpXmlRpc::$xmlrpcstr['invalid_xml'] . ' ' . $_xh['isf_reason'], '', $httpResponse); |
|
339 | + PhpXmlRpc::$xmlrpcstr['invalid_xml'].' '.$_xh['isf_reason'], '', $httpResponse); |
|
340 | 340 | |
341 | - if ($this->debug > 0) { |
|
341 | + if ($this->debug>0) { |
|
342 | 342 | $this->getLogger()->debug($_xh['isf_reason']); |
343 | 343 | } |
344 | 344 | } |
345 | 345 | // second error check: xml well-formed but not xml-rpc compliant |
346 | 346 | elseif ($_xh['isf'] == 2) { |
347 | 347 | $r = new Response(0, PhpXmlRpc::$xmlrpcerr['xml_not_compliant'], |
348 | - PhpXmlRpc::$xmlrpcstr['xml_not_compliant'] . ' ' . $_xh['isf_reason'], '', $httpResponse); |
|
348 | + PhpXmlRpc::$xmlrpcstr['xml_not_compliant'].' '.$_xh['isf_reason'], '', $httpResponse); |
|
349 | 349 | |
350 | 350 | /// @todo echo something for the user? check if it was already done by the parser... |
351 | 351 | //if ($this->debug > 0) { |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | } |
355 | 355 | // third error check: parsing of the response has somehow gone boink. |
356 | 356 | /// @todo shall we omit this check, since we trust the parsing code? |
357 | - elseif ($_xh['isf'] > 3 || $returnType == XMLParser::RETURN_XMLRPCVALS && !is_object($_xh['value'])) { |
|
357 | + elseif ($_xh['isf']>3 || $returnType == XMLParser::RETURN_XMLRPCVALS && !is_object($_xh['value'])) { |
|
358 | 358 | // something odd has happened and it's time to generate a client side error indicating something odd went on |
359 | 359 | $r = new Response(0, PhpXmlRpc::$xmlrpcerr['xml_parsing_error'], PhpXmlRpc::$xmlrpcstr['xml_parsing_error'], |
360 | 360 | '', $httpResponse |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | |
363 | 363 | /// @todo echo something for the user? |
364 | 364 | } else { |
365 | - if ($this->debug > 1) { |
|
365 | + if ($this->debug>1) { |
|
366 | 366 | $this->getLogger()->debug( |
367 | 367 | "---PARSED---\n".var_export($_xh['value'], true)."\n---END---" |
368 | 368 | ); |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | if ($errNo == 0) { |
387 | 387 | // FAULT returned, errno needs to reflect that |
388 | 388 | /// @todo feature creep - add this code to PhpXmlRpc::$xmlrpcerr |
389 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': fault response received with faultCode 0 or null. Converted it to -1'); |
|
389 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': fault response received with faultCode 0 or null. Converted it to -1'); |
|
390 | 390 | $errNo = -1; |
391 | 391 | } |
392 | 392 | |
@@ -432,12 +432,12 @@ discard block |
||
432 | 432 | case '_php_class': |
433 | 433 | case 'payload': |
434 | 434 | case 'content_type': |
435 | - $this->logDeprecation('Getting property Request::' . $name . ' is deprecated'); |
|
435 | + $this->logDeprecation('Getting property Request::'.$name.' is deprecated'); |
|
436 | 436 | return $this->$name; |
437 | 437 | default: |
438 | 438 | /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout... |
439 | 439 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); |
440 | - trigger_error('Undefined property via __get(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); |
|
440 | + trigger_error('Undefined property via __get(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); |
|
441 | 441 | $result = null; |
442 | 442 | return $result; |
443 | 443 | } |
@@ -451,13 +451,13 @@ discard block |
||
451 | 451 | case 'debug': |
452 | 452 | case 'payload': |
453 | 453 | case 'content_type': |
454 | - $this->logDeprecation('Setting property Request::' . $name . ' is deprecated'); |
|
454 | + $this->logDeprecation('Setting property Request::'.$name.' is deprecated'); |
|
455 | 455 | $this->$name = $value; |
456 | 456 | break; |
457 | 457 | default: |
458 | 458 | /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout... |
459 | 459 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); |
460 | - trigger_error('Undefined property via __set(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); |
|
460 | + trigger_error('Undefined property via __set(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); |
|
461 | 461 | } |
462 | 462 | } |
463 | 463 | |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | case 'debug': |
470 | 470 | case 'payload': |
471 | 471 | case 'content_type': |
472 | - $this->logDeprecation('Checking property Request::' . $name . ' is deprecated'); |
|
472 | + $this->logDeprecation('Checking property Request::'.$name.' is deprecated'); |
|
473 | 473 | return isset($this->$name); |
474 | 474 | default: |
475 | 475 | return false; |
@@ -484,13 +484,13 @@ discard block |
||
484 | 484 | case 'debug': |
485 | 485 | case 'payload': |
486 | 486 | case 'content_type': |
487 | - $this->logDeprecation('Unsetting property Request::' . $name . ' is deprecated'); |
|
487 | + $this->logDeprecation('Unsetting property Request::'.$name.' is deprecated'); |
|
488 | 488 | unset($this->$name); |
489 | 489 | break; |
490 | 490 | default: |
491 | 491 | /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout... |
492 | 492 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); |
493 | - trigger_error('Undefined property via __unset(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); |
|
493 | + trigger_error('Undefined property via __unset(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); |
|
494 | 494 | } |
495 | 495 | } |
496 | 496 | } |