Skip to content

Commit

Permalink
fix behavior and typos
Browse files Browse the repository at this point in the history
  • Loading branch information
tuyakhov committed Oct 9, 2016
1 parent 65b71b6 commit abdad3e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,17 @@ Example of notification that covers the case when an invoice has been paid:

```php
use tuyakhov\notifications\NotificationInterface;
use tuyakhov\notifications\NotificationTrait;

class InvoicePaid implements NotificationInterface
{
use NotificationTrait;

private $invoice;

public function __cunstruct($invoice)
public function __construct($invoice)
{
$this->invoice = $invoice
$this->invoice = $invoice;
}

public function exportForMail() {
Expand Down
6 changes: 3 additions & 3 deletions src/NotifiableBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class NotifiableBehavior extends Behavior
public function init()
{
parent::init();
$this->notifier = Instance::of($this->notifier);
$this->notifier = Instance::ensure($this->notifier, 'tuyakhov\notifications\Notifier');
}

/**
Expand Down Expand Up @@ -75,8 +75,8 @@ public function handle(Event $event)
}
$notification = $event->data['notification'];
$config = [];
foreach (get_object_vars($event) as $param) {
$config[$param] = $event->$param;
foreach (get_object_vars($event) as $param => $value) {
$config[$param] = $value;
}
$config['class'] = $notification;
/**
Expand Down

0 comments on commit abdad3e

Please sign in to comment.