Skip to content

Commit

Permalink
Merge pull request #3 from laravel-notification-channels/analysis-8A7ABZ
Browse files Browse the repository at this point in the history
Applied fixes from StyleCI
  • Loading branch information
freekmurze authored Aug 15, 2016
2 parents 2f05193 + 02aeb4c commit e45bf1f
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 14 deletions.
10 changes: 5 additions & 5 deletions src/Attachment/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,21 +154,21 @@ public function toArray()
$payload = [];
$payload['type'] = $this->type;

if (!isset($this->title)) {
if (! isset($this->title)) {
throw CouldNotCreateButton::titleNotProvided();
}

$this->validateTitle();
$payload['title'] = $this->title;

if ($this->isType(self::TYPE_WEB_URL)) {
if (!isset($this->data)) {
if (! isset($this->data)) {
throw CouldNotCreateButton::urlNotProvided();
}

$payload['url'] = $this->data;
} else {
if (!isset($this->data)) {
if (! isset($this->data)) {
throw CouldNotCreateButton::dataNotProvided($this->type);
}

Expand Down Expand Up @@ -225,8 +225,8 @@ protected function validatePayload()
*/
protected function validatePhoneNumber()
{
if ($this->isType(self::TYPE_PHONE_NUMBER) && !starts_with($this->data, '+')) {
if ($this->isType(self::TYPE_PHONE_NUMBER) && ! starts_with($this->data, '+')) {
throw CouldNotCreateButton::invalidPhoneNumberProvided($this->data);
}
}
}
}
1 change: 0 additions & 1 deletion src/Events/SendingMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class SendingMessage
{

protected $notifiable;

/** @var \Illuminate\Notifications\Notification */
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/CouldNotCreateButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static function invalidPhoneNumberProvided($phoneNumber)
return new static(
"Provided phone number `{$phoneNumber}` format is invalid.".
"Format must be '+' prefix followed by the country code, area code and local number.".
"Please check the button template docs for more information."
'Please check the button template docs for more information.'
);
}
}
2 changes: 1 addition & 1 deletion src/Facebook.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ protected function api($endpoint, $options, $method = 'GET')
throw CouldNotSendNotification::couldNotCommunicateWithFacebook();
}
}
}
}
4 changes: 2 additions & 2 deletions src/FacebookChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(Facebook $fb)
*/
public function send($notifiable, Notification $notification)
{
if (!$this->shouldSendMessage($notifiable, $notification)) {
if (! $this->shouldSendMessage($notifiable, $notification)) {
return;
}

Expand All @@ -39,7 +39,7 @@ public function send($notifiable, Notification $notification)
}

if ($message->toNotGiven()) {
if (!$to = $notifiable->routeNotificationFor('facebook')) {
if (! $to = $notifiable->routeNotificationFor('facebook')) {
return;
}

Expand Down
3 changes: 1 addition & 2 deletions src/FacebookMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function buttons(array $buttons = [])
*/
public function toNotGiven()
{
return !isset($this->recipient);
return ! isset($this->recipient);
}

/**
Expand Down Expand Up @@ -146,4 +146,3 @@ public function toArray()
return $payload;
}
}

1 change: 0 additions & 1 deletion src/FacebookServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ public function boot()

return new Facebook($pageToken);
});

}
}
2 changes: 1 addition & 1 deletion src/NotificationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ interface NotificationType

/** Not emit */
const NO_PUSH = 'NO_PUSH';
}
}

0 comments on commit e45bf1f

Please sign in to comment.