@@ -16,8 +16,7 @@ discard block |
||
| 16 | 16 | if ($statusCode == 201 || $statusCode == 204) |
| 17 | 17 | { |
| 18 | 18 | $this->succeed = TRUE; |
| 19 | - } |
|
| 20 | - else |
|
| 19 | + } else |
|
| 21 | 20 | { |
| 22 | 21 | $this->parseErrorResponse($statusCode, $content); |
| 23 | 22 | } |
@@ -40,23 +39,19 @@ discard block |
||
| 40 | 39 | throw new SubscriptionAlreadyExistException($statusCode, $result['Message'], $exception, $result['Code'], $result['RequestId'], $result['HostId']); |
| 41 | 40 | } |
| 42 | 41 | throw new MnsException($statusCode, $result['Message'], $exception, $result['Code'], $result['RequestId'], $result['HostId']); |
| 43 | - } |
|
| 44 | - catch (\Exception $e) |
|
| 42 | + } catch (\Exception $e) |
|
| 45 | 43 | { |
| 46 | 44 | if ($exception != NULL) |
| 47 | 45 | { |
| 48 | 46 | throw $exception; |
| 49 | - } |
|
| 50 | - elseif ($e instanceof MnsException) |
|
| 47 | + } elseif ($e instanceof MnsException) |
|
| 51 | 48 | { |
| 52 | 49 | throw $e; |
| 53 | - } |
|
| 54 | - else |
|
| 50 | + } else |
|
| 55 | 51 | { |
| 56 | 52 | throw new MnsException($statusCode, $e->getMessage()); |
| 57 | 53 | } |
| 58 | - } |
|
| 59 | - catch (\Throwable $t) |
|
| 54 | + } catch (\Throwable $t) |
|
| 60 | 55 | { |
| 61 | 56 | throw new MnsException($statusCode, $t->getMessage()); |
| 62 | 57 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | } catch (\Exception $e) { |
| 74 | 74 | if ($exception != NULL) { |
| 75 | 75 | throw $exception; |
| 76 | - } elseif($e instanceof MnsException) { |
|
| 76 | + } elseif ($e instanceof MnsException) { |
|
| 77 | 77 | throw $e; |
| 78 | 78 | } else { |
| 79 | 79 | throw new MnsException($statusCode, $e->getMessage()); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | while ($xmlReader->read()) |
| 90 | 90 | { |
| 91 | 91 | if ($xmlReader->nodeType == \XMLReader::ELEMENT && $xmlReader->name == 'Message') { |
| 92 | - $ex->addSendMessageResponseItem( SendMessageResponseItem::fromXML($xmlReader)); |
|
| 92 | + $ex->addSendMessageResponseItem(SendMessageResponseItem::fromXML($xmlReader)); |
|
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | throw $ex; |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | */ |
| 56 | 56 | protected function registerConnector($manager) |
| 57 | 57 | { |
| 58 | - $manager->addConnector('mns', function () { |
|
| 58 | + $manager->addConnector('mns', function() { |
|
| 59 | 59 | return new MnsConnector(); |
| 60 | 60 | }); |
| 61 | 61 | } |
@@ -70,11 +70,11 @@ |
||
| 70 | 70 | } |
| 71 | 71 | $marker = $res->getNextMarker(); |
| 72 | 72 | if ($marker) { |
| 73 | - $this->question('---下一页:['.base64_decode($marker).']---'); |
|
| 73 | + $this->question('---下一页:[' . base64_decode($marker) . ']---'); |
|
| 74 | 74 | $this->listQueue($client, $prefix, $marker); |
| 75 | 75 | } |
| 76 | 76 | } catch (MnsException $e) { |
| 77 | - $this->error('查询队列失败:'.$e); |
|
| 77 | + $this->error('查询队列失败:' . $e); |
|
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | $client = new Client($config['endpoint'], $config['key'], $config['secret']); |
| 51 | 51 | $queue = $client->getQueueRef($queueName); |
| 52 | - $this->alert('队列:'.$queueName); |
|
| 52 | + $this->alert('队列:' . $queueName); |
|
| 53 | 53 | $this->info('拉取信息中...'); |
| 54 | 54 | |
| 55 | 55 | try { |
@@ -60,13 +60,13 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | foreach ($messages as $message) { |
| 62 | 62 | $this->info('------------'); |
| 63 | - $this->info('消息编号'.$message->getMessageId()); |
|
| 64 | - $this->info('消息正文的 MD5 值'.$message->getMessageBodyMD5()); |
|
| 65 | - $this->info('消息正文'.$message->getMessageBody()); |
|
| 66 | - $this->info('消息发送到队列的时间'.$message->getEnqueueTime()); |
|
| 67 | - $this->info('第一次被消费的时间'.$message->getFirstDequeueTime()); |
|
| 68 | - $this->info('总共被消费的次数'.$message->getDequeueCount()); |
|
| 69 | - $this->info('消息的优先级权值'.$message->getPriority()); |
|
| 63 | + $this->info('消息编号' . $message->getMessageId()); |
|
| 64 | + $this->info('消息正文的 MD5 值' . $message->getMessageBodyMD5()); |
|
| 65 | + $this->info('消息正文' . $message->getMessageBody()); |
|
| 66 | + $this->info('消息发送到队列的时间' . $message->getEnqueueTime()); |
|
| 67 | + $this->info('第一次被消费的时间' . $message->getFirstDequeueTime()); |
|
| 68 | + $this->info('总共被消费的次数' . $message->getDequeueCount()); |
|
| 69 | + $this->info('消息的优先级权值' . $message->getPriority()); |
|
| 70 | 70 | $this->info('------------'); |
| 71 | 71 | } |
| 72 | 72 | } |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | $this->info('队列删除成功'); |
| 54 | 54 | $this->alert($queue); |
| 55 | 55 | } catch (MnsException $e) { |
| 56 | - $this->error('队列删除失败:'.$e); |
|
| 56 | + $this->error('队列删除失败:' . $e); |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | } |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | if (!$queue) { |
| 48 | 48 | $queue = $config['queue']; |
| 49 | 49 | } |
| 50 | - $this->alert('队列:'.$queue); |
|
| 50 | + $this->alert('队列:' . $queue); |
|
| 51 | 51 | $client = new Client($config['endpoint'], $config['key'], $config['secret']); |
| 52 | 52 | $queue = $client->getQueueRef($queue); |
| 53 | 53 | $hasMessage = true; |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | $this->info('队列创建成功'); |
| 56 | 56 | $this->alert($queue); |
| 57 | 57 | } catch (MnsException $e) { |
| 58 | - $this->error('队列创建失败:'.$e); |
|
| 58 | + $this->error('队列创建失败:' . $e); |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | } |
@@ -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()); |