Skip to content

Commit

Permalink
Fixes for code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
neoighodaro committed Jan 6, 2019
1 parent b1112be commit 6744e09
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 38 deletions.
2 changes: 1 addition & 1 deletion src/EarlyAccess.php
Expand Up @@ -82,7 +82,7 @@ public function addAllowedNetworksToBeacon(array $networks)
*/
public function saveBeacon(array $allowed = []): bool
{
if ($data = $this->getBeaconDetails()) {
if ($this->getBeaconDetails()) {
return (bool) $this->addAllowedNetworksToBeacon($allowed);
}

Expand Down
21 changes: 3 additions & 18 deletions src/Notifications/UserSubscribed.php
Expand Up @@ -13,7 +13,7 @@ class UserSubscribed extends Notification implements ShouldQueue
use Queueable;

/**
* @var \Neo\EarlyAccess\Notifications\Subscriber
* @var \Neo\EarlyAccess\Subscriber
*/
public $subscriber;

Expand All @@ -30,38 +30,23 @@ public function __construct(Subscriber $subscriber)
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
public function via()
{
return ['mail'];
}

/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
public function toMail()
{
return (new MailMessage)
->subject(trans('early-access::mail.subscribed.subject', ['name' => config('app.name')]))
->line(trans('early-access::mail.subscribed.message.intro', ['name' => config('app.name')]))
->action('Share on Twitter', route('early-access.share'));
}

/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
//
];
}
}
21 changes: 3 additions & 18 deletions src/Notifications/UserUnsubscribed.php
Expand Up @@ -13,7 +13,7 @@ class UserUnsubscribed extends Notification implements ShouldQueue
use Queueable;

/**
* @var \Neo\EarlyAccess\Notifications\Subscriber
* @var \Neo\EarlyAccess\Subscriber
*/
public $subscriber;

Expand All @@ -30,37 +30,22 @@ public function __construct(Subscriber $subscriber)
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
public function via()
{
return ['mail'];
}

/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
public function toMail()
{
return (new MailMessage)
->subject(trans('early-access::mail.unsubscribed.subject', ['name' => config('app.name')]))
->line(trans('early-access::mail.unsubscribed.message.intro'));
}

/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
//
];
}
}
6 changes: 6 additions & 0 deletions src/Subscriber.php
Expand Up @@ -8,6 +8,12 @@
use Neo\EarlyAccess\Events\UserUnsubscribed;
use Neo\EarlyAccess\Contracts\Subscription\SubscriptionProvider;

/**
* @property string|null email
* @property string|null name
* @property string|null subscribed_at
* @property boolean verified
*/
class Subscriber implements Arrayable
{
use Notifiable;
Expand Down
2 changes: 1 addition & 1 deletion src/SubscriptionServices/DatabaseService.php
Expand Up @@ -9,7 +9,7 @@
class DatabaseService implements SubscriptionProvider
{
/**
* @var \Neo\EarlyAccess\SubscriptionServices\DatabaseRepository\SubscriptionRepository
* @var \Neo\EarlyAccess\Contracts\Subscription\SubscriptionRepository
*/
protected $repository;

Expand Down

0 comments on commit 6744e09

Please sign in to comment.