@@ -138,7 +138,7 @@ |
||
138 | 138 | if ($callback != NULL) |
139 | 139 | { |
140 | 140 | return $this->client->sendAsync($request, $parameters)->then( |
141 | - function ($res) use (&$response, $callback) { |
|
141 | + function($res) use (&$response, $callback) { |
|
142 | 142 | try { |
143 | 143 | $response->parseResponse($res->getStatusCode(), $res->getBody()); |
144 | 144 | $callback->onSucceed($response); |
@@ -147,13 +147,11 @@ |
||
147 | 147 | } |
148 | 148 | } |
149 | 149 | ); |
150 | - } |
|
151 | - else |
|
150 | + } else |
|
152 | 151 | { |
153 | 152 | return $this->client->sendAsync($request, $parameters); |
154 | 153 | } |
155 | - } |
|
156 | - catch (TransferException $e) |
|
154 | + } catch (TransferException $e) |
|
157 | 155 | { |
158 | 156 | $message = $e->getMessage(); |
159 | 157 | if ($e->hasResponse()) { |
@@ -29,8 +29,7 @@ discard block |
||
29 | 29 | if ($retNum != NULL) |
30 | 30 | { |
31 | 31 | $this->setHeader("x-mns-ret-number", $retNum); |
32 | - } |
|
33 | - else |
|
32 | + } else |
|
34 | 33 | { |
35 | 34 | $this->removeHeader("x-mns-ret-number"); |
36 | 35 | } |
@@ -47,8 +46,7 @@ discard block |
||
47 | 46 | if ($prefix != NULL) |
48 | 47 | { |
49 | 48 | $this->setHeader("x-mns-prefix", $prefix); |
50 | - } |
|
51 | - else |
|
49 | + } else |
|
52 | 50 | { |
53 | 51 | $this->removeHeader("x-mns-prefix"); |
54 | 52 | } |
@@ -65,8 +63,7 @@ discard block |
||
65 | 63 | if ($marker != NULL) |
66 | 64 | { |
67 | 65 | $this->setHeader("x-mns-marker", $marker); |
68 | - } |
|
69 | - else |
|
66 | + } else |
|
70 | 67 | { |
71 | 68 | $this->removeHeader("x-mns-marker"); |
72 | 69 | } |
@@ -66,12 +66,10 @@ discard block |
||
66 | 66 | } |
67 | 67 | } |
68 | 68 | } |
69 | - } |
|
70 | - catch (\Exception $e) |
|
69 | + } catch (\Exception $e) |
|
71 | 70 | { |
72 | 71 | throw new MnsException($statusCode, $e->getMessage(), $e); |
73 | - } |
|
74 | - catch (\Throwable $t) |
|
72 | + } catch (\Throwable $t) |
|
75 | 73 | { |
76 | 74 | throw new MnsException($statusCode, $t->getMessage()); |
77 | 75 | } |
@@ -97,23 +95,19 @@ discard block |
||
97 | 95 | $result = XMLParser::parseNormalError($xmlReader); |
98 | 96 | |
99 | 97 | throw new MnsException($statusCode, $result['Message'], $exception, $result['Code'], $result['RequestId'], $result['HostId']); |
100 | - } |
|
101 | - catch (\Exception $e) |
|
98 | + } catch (\Exception $e) |
|
102 | 99 | { |
103 | 100 | if ($exception != NULL) |
104 | 101 | { |
105 | 102 | throw $exception; |
106 | - } |
|
107 | - elseif ($e instanceof MnsException) |
|
103 | + } elseif ($e instanceof MnsException) |
|
108 | 104 | { |
109 | 105 | throw $e; |
110 | - } |
|
111 | - else |
|
106 | + } else |
|
112 | 107 | { |
113 | 108 | throw new MnsException($statusCode, $e->getMessage()); |
114 | 109 | } |
115 | - } |
|
116 | - catch (\Throwable $t) |
|
110 | + } catch (\Throwable $t) |
|
117 | 111 | { |
118 | 112 | throw new MnsException($statusCode, $t->getMessage()); |
119 | 113 | } |
@@ -50,7 +50,7 @@ |
||
50 | 50 | } catch (\Exception $e) { |
51 | 51 | if ($exception != NULL) { |
52 | 52 | throw $exception; |
53 | - } elseif($e instanceof MnsException) { |
|
53 | + } elseif ($e instanceof MnsException) { |
|
54 | 54 | throw $e; |
55 | 55 | } else { |
56 | 56 | throw new MnsException($statusCode, $e->getMessage()); |
@@ -40,17 +40,14 @@ |
||
40 | 40 | throw new SubscriptionNotExistException($statusCode, $result['Message'], $exception, $result['Code'], $result['RequestId'], $result['HostId']); |
41 | 41 | } |
42 | 42 | throw new MnsException($statusCode, $result['Message'], $exception, $result['Code'], $result['RequestId'], $result['HostId']); |
43 | - } |
|
44 | - catch (\Exception $e) |
|
43 | + } catch (\Exception $e) |
|
45 | 44 | { |
46 | 45 | if ($exception != NULL) { |
47 | 46 | throw $exception; |
48 | - } |
|
49 | - elseif ($e instanceof MnsException) |
|
47 | + } elseif ($e instanceof MnsException) |
|
50 | 48 | { |
51 | 49 | throw $e; |
52 | - } |
|
53 | - else |
|
50 | + } else |
|
54 | 51 | { |
55 | 52 | throw new MnsException($statusCode, $e->getMessage()); |
56 | 53 | } |
@@ -17,8 +17,7 @@ |
||
17 | 17 | if ($statusCode == 204) |
18 | 18 | { |
19 | 19 | $this->succeed = TRUE; |
20 | - } |
|
21 | - else |
|
20 | + } else |
|
22 | 21 | { |
23 | 22 | $this->parseErrorResponse($statusCode, $content); |
24 | 23 | } |
@@ -50,7 +50,7 @@ |
||
50 | 50 | } catch (\Exception $e) { |
51 | 51 | if ($exception != NULL) { |
52 | 52 | throw $exception; |
53 | - } elseif($e instanceof MnsException) { |
|
53 | + } elseif ($e instanceof MnsException) { |
|
54 | 54 | throw $e; |
55 | 55 | } else { |
56 | 56 | throw new MnsException($statusCode, $e->getMessage()); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } catch (\Exception $e) { |
50 | 50 | if ($exception != NULL) { |
51 | 51 | throw $exception; |
52 | - } elseif($e instanceof MnsException) { |
|
52 | + } elseif ($e instanceof MnsException) { |
|
53 | 53 | throw $e; |
54 | 54 | } else { |
55 | 55 | throw new MnsException($statusCode, $e->getMessage()); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | while ($xmlReader->read()) |
66 | 66 | { |
67 | 67 | if ($xmlReader->nodeType == \XMLReader::ELEMENT && $xmlReader->name == Constants::ERROR) { |
68 | - $ex->addDeleteMessageErrorItem( DeleteMessageErrorItem::fromXML($xmlReader)); |
|
68 | + $ex->addDeleteMessageErrorItem(DeleteMessageErrorItem::fromXML($xmlReader)); |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | throw $ex; |
@@ -28,8 +28,7 @@ discard block |
||
28 | 28 | if ($statusCode == 200) |
29 | 29 | { |
30 | 30 | $this->succeed = TRUE; |
31 | - } |
|
32 | - else |
|
31 | + } else |
|
33 | 32 | { |
34 | 33 | $this->parseErrorResponse($statusCode, $content); |
35 | 34 | } |
@@ -39,12 +38,10 @@ discard block |
||
39 | 38 | try |
40 | 39 | { |
41 | 40 | $this->attributes = SubscriptionAttributes::fromXML($xmlReader); |
42 | - } |
|
43 | - catch (\Exception $e) |
|
41 | + } catch (\Exception $e) |
|
44 | 42 | { |
45 | 43 | throw new MnsException($statusCode, $e->getMessage(), $e); |
46 | - } |
|
47 | - catch (\Throwable $t) |
|
44 | + } catch (\Throwable $t) |
|
48 | 45 | { |
49 | 46 | throw new MnsException($statusCode, $t->getMessage()); |
50 | 47 | } |
@@ -63,23 +60,19 @@ discard block |
||
63 | 60 | throw new SubscriptionNotExistException($statusCode, $result['Message'], $exception, $result['Code'], $result['RequestId'], $result['HostId']); |
64 | 61 | } |
65 | 62 | throw new MnsException($statusCode, $result['Message'], $exception, $result['Code'], $result['RequestId'], $result['HostId']); |
66 | - } |
|
67 | - catch (\Exception $e) |
|
63 | + } catch (\Exception $e) |
|
68 | 64 | { |
69 | 65 | if ($exception != NULL) |
70 | 66 | { |
71 | 67 | throw $exception; |
72 | - } |
|
73 | - elseif ($e instanceof MnsException) |
|
68 | + } elseif ($e instanceof MnsException) |
|
74 | 69 | { |
75 | 70 | throw $e; |
76 | - } |
|
77 | - else |
|
71 | + } else |
|
78 | 72 | { |
79 | 73 | throw new MnsException($statusCode, $e->getMessage()); |
80 | 74 | } |
81 | - } |
|
82 | - catch (\Throwable $t) |
|
75 | + } catch (\Throwable $t) |
|
83 | 76 | { |
84 | 77 | throw new MnsException($statusCode, $t->getMessage()); |
85 | 78 | } |
@@ -40,23 +40,19 @@ |
||
40 | 40 | throw new TopicNotExistException($statusCode, $result['Message'], $exception, $result['Code'], $result['RequestId'], $result['HostId']); |
41 | 41 | } |
42 | 42 | throw new MnsException($statusCode, $result['Message'], $exception, $result['Code'], $result['RequestId'], $result['HostId']); |
43 | - } |
|
44 | - catch (\Exception $e) |
|
43 | + } catch (\Exception $e) |
|
45 | 44 | { |
46 | 45 | if ($exception != NULL) |
47 | 46 | { |
48 | 47 | throw $exception; |
49 | - } |
|
50 | - elseif ($e instanceof MnsException) |
|
48 | + } elseif ($e instanceof MnsException) |
|
51 | 49 | { |
52 | 50 | throw $e; |
53 | - } |
|
54 | - else |
|
51 | + } else |
|
55 | 52 | { |
56 | 53 | throw new MnsException($statusCode, $e->getMessage()); |
57 | 54 | } |
58 | - } |
|
59 | - catch (\Throwable $t) |
|
55 | + } catch (\Throwable $t) |
|
60 | 56 | { |
61 | 57 | throw new MnsException($statusCode, $t->getMessage()); |
62 | 58 | } |