Skip to content

Commit

Permalink
Apply fixes from StyleCI (overtrue#49)
Browse files Browse the repository at this point in the history
[ci skip] [skip ci]
  • Loading branch information
overtrue authored Nov 8, 2017
1 parent af14136 commit 908181b
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Gateways/AliyunGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function send($to, MessageInterface $message, Config $config)

$result = $this->get(self::ENDPOINT_URL, $params);

if ($result['Code'] != 'OK') {
if ('OK' != $result['Code']) {
throw new GatewayErrorException($result['Message'], $result['Code'], $result);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Gateways/BaiduGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function send($to, MessageInterface $message, Config $config)

$result = $this->request('post', self::buildEndpoint($config), ['headers' => $headers, 'json' => $params]);

if ($result['code'] != self::SUCCESS_CODE) {
if (self::SUCCESS_CODE != $result['code']) {
throw new GatewayErrorException($result['message'], $result['code'], $result);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Gateways/HuaxinGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function send($to, MessageInterface $message, Config $config)
'extno' => $config->get('ext_no'),
]);

if ($result['returnstatus'] !== 'Success') {
if ('Success' !== $result['returnstatus']) {
throw new GatewayErrorException($result['message'], 400, $result);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Gateways/HuyiGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function send($to, MessageInterface $message, Config $config)

$result = $this->post(self::ENDPOINT_URL, $params);

if ($result['code'] != self::SUCCESS_CODE) {
if (self::SUCCESS_CODE != $result['code']) {
throw new GatewayErrorException($result['msg'], $result['code'], $result);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Gateways/SubmailGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function send($to, MessageInterface $message, Config $config)
'vars' => json_encode($message->getData($this), JSON_FORCE_OBJECT),
]);

if ($result['status'] != 'success') {
if ('success' != $result['status']) {
throw new GatewayErrorException($result['msg'], $result['code'], $result);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Gateways/YuntongxunGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function send($to, MessageInterface $message, Config $config)
],
]);

if ($result['statusCode'] != self::SUCCESS_CODE) {
if (self::SUCCESS_CODE != $result['statusCode']) {
throw new GatewayErrorException($result['statusCode'], $result['statusCode'], $result);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Gateways/SendcloudGatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function testTimestampConfig()

$gateway->shouldReceive('post')
->with(sprintf(SendcloudGateway::ENDPOINT_TEMPLATE, 'send'), \Mockery::on(function ($params) {
return isset($params['timestamp']) && strlen($params['timestamp']) == 13 && $params['timestamp'] <= time() * 1000;
return isset($params['timestamp']) && 13 == strlen($params['timestamp']) && $params['timestamp'] <= time() * 1000;
}))->andReturn([
'message' => '操作成功',
'result' => true,
Expand Down

0 comments on commit 908181b

Please sign in to comment.