@@ -20,8 +20,7 @@ |
||
20 | 20 | $this->check_exists($fname); |
21 | 21 | |
22 | 22 | $key = $this->load($fname); |
23 | - } |
|
24 | - catch (\Exception $e) |
|
23 | + } catch (\Exception $e) |
|
25 | 24 | { |
26 | 25 | throw new Exception\Runtime('The file with the '.$type.' key was '.$e->getMessage().'!', -98); |
27 | 26 | } |
@@ -71,20 +71,16 @@ |
||
71 | 71 | $this->response = $this->get_response(); |
72 | 72 | |
73 | 73 | Log::instance()->add('the request was processed successfully'); |
74 | - } |
|
75 | - catch (Exception\Structure $e) |
|
74 | + } catch (Exception\Structure $e) |
|
76 | 75 | { |
77 | 76 | $this->response = $this->get_error_response($e->getCode(), 'Error in request'); |
78 | - } |
|
79 | - catch (Exception\Sign $e) |
|
77 | + } catch (Exception\Sign $e) |
|
80 | 78 | { |
81 | 79 | $this->response = $this->get_error_response($e->getCode(), 'Signature error!'); |
82 | - } |
|
83 | - catch (Exception\Runtime $e) |
|
80 | + } catch (Exception\Runtime $e) |
|
84 | 81 | { |
85 | 82 | $this->response = $this->get_error_response($e->getCode(), 'Error while processing request'); |
86 | - } |
|
87 | - catch (\Exception $e) |
|
83 | + } catch (\Exception $e) |
|
88 | 84 | { |
89 | 85 | $this->response = $this->get_error_response($e->getCode(), $e->getMessage()); |
90 | 86 | } |
@@ -43,7 +43,9 @@ |
||
43 | 43 | */ |
44 | 44 | public function create_AccountInfo($accountinfo) |
45 | 45 | { |
46 | - if (isset($this->AccountInfo)) return; |
|
46 | + if (isset($this->AccountInfo)) { |
|
47 | + return; |
|
48 | + } |
|
47 | 49 | |
48 | 50 | $this->AccountInfo = $this->createElement('AccountInfo'); |
49 | 51 | $this->Response->appendChild($this->AccountInfo); |
@@ -41,7 +41,9 @@ |
||
41 | 41 | */ |
42 | 42 | public function create_CancelDate($canceldate) |
43 | 43 | { |
44 | - if (isset($this->CancelDate)) return; |
|
44 | + if (isset($this->CancelDate)) { |
|
45 | + return; |
|
46 | + } |
|
45 | 47 | |
46 | 48 | $this->CancelDate = $this->createElement('CancelDate', $canceldate); |
47 | 49 | $this->Response->appendChild($this->CancelDate); |
@@ -42,7 +42,9 @@ |
||
42 | 42 | */ |
43 | 43 | public function create_OrderDate($orderdate) |
44 | 44 | { |
45 | - if (isset($this->OrderDate)) return; |
|
45 | + if (isset($this->OrderDate)) { |
|
46 | + return; |
|
47 | + } |
|
46 | 48 | |
47 | 49 | $this->OrderDate = $this->createElement('OrderDate', $orderdate); |
48 | 50 | $this->Response->appendChild($this->OrderDate); |
@@ -42,7 +42,9 @@ |
||
42 | 42 | */ |
43 | 43 | public function create_PaymentId($paymentid) |
44 | 44 | { |
45 | - if (isset($this->PaymentId)) return; |
|
45 | + if (isset($this->PaymentId)) { |
|
46 | + return; |
|
47 | + } |
|
46 | 48 | |
47 | 49 | $this->PaymentId = $this->createElement('PaymentId', $paymentid); |
48 | 50 | $this->Response->appendChild($this->PaymentId); |
@@ -122,7 +122,9 @@ discard block |
||
122 | 122 | */ |
123 | 123 | protected function sign($options) |
124 | 124 | { |
125 | - if (isset($this->Sign)) return; |
|
125 | + if (isset($this->Sign)) { |
|
126 | + return; |
|
127 | + } |
|
126 | 128 | |
127 | 129 | if (isset($options['UseSign']) && ($options['UseSign'] === true)) |
128 | 130 | { |
@@ -155,8 +157,7 @@ discard block |
||
155 | 157 | ); |
156 | 158 | |
157 | 159 | return strtoupper(bin2hex($sign)); |
158 | - } |
|
159 | - catch (\Exception $e) |
|
160 | + } catch (\Exception $e) |
|
160 | 161 | { |
161 | 162 | return null; |
162 | 163 | } |
@@ -140,8 +140,7 @@ discard block |
||
140 | 140 | if ( ! isset($this->Operation)) |
141 | 141 | { |
142 | 142 | $this->Operation = $child->nodeName; |
143 | - } |
|
144 | - else |
|
143 | + } else |
|
145 | 144 | { |
146 | 145 | throw new Exception\Structure('There is more than one Operation type element in the xml-query!', -53); |
147 | 146 | } |
@@ -189,8 +188,7 @@ discard block |
||
189 | 188 | if ( ! isset($this->$name)) |
190 | 189 | { |
191 | 190 | $this->$name = $n->nodeValue; |
192 | - } |
|
193 | - else |
|
191 | + } else |
|
194 | 192 | { |
195 | 193 | throw new Exception\Structure('There is more than one '.$name.' element in the xml-query!', -56); |
196 | 194 | } |
@@ -276,8 +274,7 @@ discard block |
||
276 | 274 | if ($result == -1) |
277 | 275 | { |
278 | 276 | throw new Exception\Sign('Error verify signature of request!', -96); |
279 | - } |
|
280 | - elseif ($result == 0) |
|
277 | + } elseif ($result == 0) |
|
281 | 278 | { |
282 | 279 | throw new Exception\Sign('Signature of request is incorrect!', -95); |
283 | 280 | } |
@@ -299,8 +296,7 @@ discard block |
||
299 | 296 | if ($child->nodeName == $name) |
300 | 297 | { |
301 | 298 | array_push($ret, $child); |
302 | - } |
|
303 | - else |
|
299 | + } else |
|
304 | 300 | { |
305 | 301 | if (count($child->childNodes) > 0) |
306 | 302 | { |