@@ -17,7 +17,7 @@ |
||
17 | 17 | public $isHtml; |
18 | 18 | |
19 | 19 | public function __construct( |
20 | - $subject, $accountName, $addressType=0, $replyToAddress=false, $isHtml = false) |
|
20 | + $subject, $accountName, $addressType = 0, $replyToAddress = false, $isHtml = false) |
|
21 | 21 | { |
22 | 22 | $this->subject = $subject; |
23 | 23 | $this->accountName = $accountName; |
@@ -90,8 +90,7 @@ discard block |
||
90 | 90 | if ($this->addressType !== NULL) |
91 | 91 | { |
92 | 92 | $jsonArray[Constants::ADDRESS_TYPE] = $this->addressType; |
93 | - } |
|
94 | - else |
|
93 | + } else |
|
95 | 94 | { |
96 | 95 | $jsonArray[Constants::ADDRESS_TYPE] = 0; |
97 | 96 | } |
@@ -100,8 +99,7 @@ discard block |
||
100 | 99 | if ($this->replyToAddress === TRUE) |
101 | 100 | { |
102 | 101 | $jsonArray[Constants::REPLY_TO_ADDRESS] = "1"; |
103 | - } |
|
104 | - else |
|
102 | + } else |
|
105 | 103 | { |
106 | 104 | $jsonArray[Constants::REPLY_TO_ADDRESS] = "0"; |
107 | 105 | } |
@@ -111,8 +109,7 @@ discard block |
||
111 | 109 | if ($this->isHtml === TRUE) |
112 | 110 | { |
113 | 111 | $jsonArray[Constants::IS_HTML] = "1"; |
114 | - } |
|
115 | - else |
|
112 | + } else |
|
116 | 113 | { |
117 | 114 | $jsonArray[Constants::IS_HTML] = "0"; |
118 | 115 | } |
@@ -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 | } |
@@ -40,8 +40,7 @@ discard block |
||
40 | 40 | if ($retNum != NULL) |
41 | 41 | { |
42 | 42 | $this->setHeader("x-mns-ret-number", $retNum); |
43 | - } |
|
44 | - else |
|
43 | + } else |
|
45 | 44 | { |
46 | 45 | $this->removeHeader("x-mns-ret-number"); |
47 | 46 | } |
@@ -58,8 +57,7 @@ discard block |
||
58 | 57 | if ($prefix != NULL) |
59 | 58 | { |
60 | 59 | $this->setHeader("x-mns-prefix", $prefix); |
61 | - } |
|
62 | - else |
|
60 | + } else |
|
63 | 61 | { |
64 | 62 | $this->removeHeader("x-mns-prefix"); |
65 | 63 | } |
@@ -76,8 +74,7 @@ discard block |
||
76 | 74 | if ($marker != NULL) |
77 | 75 | { |
78 | 76 | $this->setHeader("x-mns-marker", $marker); |
79 | - } |
|
80 | - else |
|
77 | + } else |
|
81 | 78 | { |
82 | 79 | $this->removeHeader("x-mns-marker"); |
83 | 80 | } |
@@ -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()); |
@@ -83,7 +83,7 @@ |
||
83 | 83 | } catch (\Exception $e) { |
84 | 84 | if ($exception != NULL) { |
85 | 85 | throw $exception; |
86 | - } elseif($e instanceof MnsException) { |
|
86 | + } elseif ($e instanceof MnsException) { |
|
87 | 87 | throw $e; |
88 | 88 | } else { |
89 | 89 | 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 | } |