Skip to content

Commit

Permalink
use constant
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangut committed May 6, 2016
1 parent 6ecae54 commit d79fc53
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Adapter/Gcm/GcmAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*/
class GcmAdapter extends AbstractAdapter implements SendAdapter
{
const RESULT_UNKNOWN = 'Unknown';

/**
* Status codes mapping.
*
Expand All @@ -41,7 +43,7 @@ class GcmAdapter extends AbstractAdapter implements SendAdapter
'InternalServerError' => 'Internal Server Error',
'DeviceMessageRateExceeded' => 'Device Message Rate Exceeded',
'TopicsMessageRateExceeded' => 'Topics Message Rate Exceeded',
'UnknownError' => 'Unknown Error',
self::RESULT_UNKNOWN => 'Unknown Error',
];

/**
Expand Down Expand Up @@ -102,7 +104,7 @@ public function send(Notification $notification)

$errorCode = array_key_exists($token, $pushResponses)
? $pushResponses[$token]['error']
: 'UnknownError';
: self::RESULT_UNKNOWN;
$result->setStatusMessage(self::$statusCodes[$errorCode]);
}

Expand Down

0 comments on commit d79fc53

Please sign in to comment.