@@ -22,7 +22,7 @@ |
||
| 22 | 22 | * @return string |
| 23 | 23 | */ |
| 24 | 24 | public function getPrincipalUrl() { |
| 25 | - return isset($this->found_props['current-user-principal']) && isset($this->found_props['current-user-principal']['href']) ? |
|
| 25 | + return isset($this->found_props['current-user-principal']) && isset($this->found_props['current-user-principal']['href']) ? |
|
| 26 | 26 | $this->server_url.$this->found_props['current-user-principal']['href'] : null; |
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | \ No newline at end of file |
@@ -42,14 +42,14 @@ discard block |
||
| 42 | 42 | * @param string|null $body |
| 43 | 43 | * @param int $code |
| 44 | 44 | */ |
| 45 | - public function __construct($server_url = null, $body = null, $code = HttpResponse::HttpCodeOk ) |
|
| 45 | + public function __construct($server_url = null, $body = null, $code = HttpResponse::HttpCodeOk) |
|
| 46 | 46 | { |
| 47 | 47 | parent::__construct($body, $code); |
| 48 | 48 | $this->server_url = $server_url; |
| 49 | - if(!empty($this->body)) { |
|
| 49 | + if (!empty($this->body)) { |
|
| 50 | 50 | $this->stripped = $this->stripNamespacesFromTags($this->body); |
| 51 | - $this->xml = simplexml_load_string($this->stripped); |
|
| 52 | - if($this->xml === FALSE) |
|
| 51 | + $this->xml = simplexml_load_string($this->stripped); |
|
| 52 | + if ($this->xml === FALSE) |
|
| 53 | 53 | throw new XMLResponseParseException(); |
| 54 | 54 | $this->content = $this->toAssocArray($this->xml); |
| 55 | 55 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | { |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - protected function setContent($content){ |
|
| 64 | + protected function setContent($content) { |
|
| 65 | 65 | $this->content = $content; |
| 66 | 66 | } |
| 67 | 67 | |
@@ -94,13 +94,13 @@ discard block |
||
| 94 | 94 | $nameSpaceDefRegEx = '(\S+)=["\']?((?:.(?!["\']?\s+(?:\S+)=|[>"\']))+.)["\']?'; |
| 95 | 95 | |
| 96 | 96 | // Cycle through each namespace and remove it from the XML string |
| 97 | - foreach( $toRemove as $remove ) { |
|
| 97 | + foreach ($toRemove as $remove) { |
|
| 98 | 98 | // First remove the namespace from the opening of the tag |
| 99 | - $xml = str_replace('<' . $remove . ':', '<', $xml); |
|
| 99 | + $xml = str_replace('<'.$remove.':', '<', $xml); |
|
| 100 | 100 | // Now remove the namespace from the closing of the tag |
| 101 | - $xml = str_replace('</' . $remove . ':', '</', $xml); |
|
| 101 | + $xml = str_replace('</'.$remove.':', '</', $xml); |
|
| 102 | 102 | // This XML uses the name space with CommentText, so remove that too |
| 103 | - $xml = str_replace($remove . ':commentText', 'commentText', $xml); |
|
| 103 | + $xml = str_replace($remove.':commentText', 'commentText', $xml); |
|
| 104 | 104 | // Complete the pattern for RegEx to remove this namespace declaration |
| 105 | 105 | $pattern = "/xmlns:{$remove}{$nameSpaceDefRegEx}/"; |
| 106 | 106 | // Remove the actual namespace declaration using the Pattern |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | /** |
| 125 | 125 | * @return bool |
| 126 | 126 | */ |
| 127 | - protected function isValid(){ |
|
| 127 | + protected function isValid() { |
|
| 128 | 128 | return isset($this->content['response']); |
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | \ No newline at end of file |
@@ -49,8 +49,9 @@ |
||
| 49 | 49 | if(!empty($this->body)) { |
| 50 | 50 | $this->stripped = $this->stripNamespacesFromTags($this->body); |
| 51 | 51 | $this->xml = simplexml_load_string($this->stripped); |
| 52 | - if($this->xml === FALSE) |
|
| 53 | - throw new XMLResponseParseException(); |
|
| 52 | + if($this->xml === FALSE) { |
|
| 53 | + throw new XMLResponseParseException(); |
|
| 54 | + } |
|
| 54 | 55 | $this->content = $this->toAssocArray($this->xml); |
| 55 | 56 | |
| 56 | 57 | $this->parse(); |