From 01ef8820e2f6e30172a04e2e958285cef5773e8e Mon Sep 17 00:00:00 2001 From: George Hanson Date: Wed, 11 May 2016 16:30:46 +0100 Subject: [PATCH 1/3] Fixed bug with driver not persisting across requests --- src/Notifier.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Notifier.php b/src/Notifier.php index ca6baad..9f7978e 100644 --- a/src/Notifier.php +++ b/src/Notifier.php @@ -66,7 +66,7 @@ public function __construct(TemplateParser $parser, Session $session, array $con public function notify($level, array $attributes = []) { if (isset($this->driver['levels'][$level])) { - $this->notifications[] = array_merge(['level' => $this->driver['levels'][$level]], $attributes); + $this->notifications[] = array_merge(['level' => $this->driver['levels'][$level], 'driver' => $this->driver], $attributes); $this->session->flash('notifications', $this->notifications); return $this; @@ -117,7 +117,8 @@ public function render() { if ($notifications = $this->session->get('notifications')) { foreach ($notifications as $key => $notification) { - $notifications[$key] = $this->parser->parse($this->driver['template'], $notification); + $driver = array_pull($notification, 'driver'); + $notifications[$key] = $this->parser->parse($driver['template'], $notification); } if ( ! empty($notifications)) { @@ -214,4 +215,4 @@ function __toString() { return $this->render(); } -} \ No newline at end of file +} From ded9fc3c95d78818d0b274911be1801e450987dd Mon Sep 17 00:00:00 2001 From: George Hanson Date: Wed, 11 May 2016 16:40:37 +0100 Subject: [PATCH 2/3] Make Notifier work with Non-laravel functions --- src/Notifier.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Notifier.php b/src/Notifier.php index 9f7978e..2b19e7d 100644 --- a/src/Notifier.php +++ b/src/Notifier.php @@ -117,7 +117,8 @@ public function render() { if ($notifications = $this->session->get('notifications')) { foreach ($notifications as $key => $notification) { - $driver = array_pull($notification, 'driver'); + $driver = $notification['driver']; + unset($notification['driver']); $notifications[$key] = $this->parser->parse($driver['template'], $notification); } From 5d5515605dffa042288e2cb80dc76e014a0b1845 Mon Sep 17 00:00:00 2001 From: George Hanson Date: Wed, 11 May 2016 16:46:33 +0100 Subject: [PATCH 3/3] Updated composer to match php coveralls version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 037b211..0d2f380 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ }, "require-dev": { "phpunit/phpunit": "4.8.*", - "satooshi/php-coveralls": "dev-master" + "satooshi/php-coveralls": "1.0.0" }, "minimum-stability": "dev" }