Skip to content

Commit

Permalink
Merge pull request #2 from DevKingDigital/master
Browse files Browse the repository at this point in the history
Fixed issue with driver not persisting across requests
  • Loading branch information
michaeljennings committed May 11, 2016
2 parents 23ea3e4 + 5d55156 commit f2d4e25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"require-dev": {
"phpunit/phpunit": "4.8.*",
"satooshi/php-coveralls": "dev-master"
"satooshi/php-coveralls": "1.0.0"
},
"minimum-stability": "dev"
}
8 changes: 5 additions & 3 deletions src/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -117,7 +117,9 @@ public function render()
{
if ($notifications = $this->session->get('notifications')) {
foreach ($notifications as $key => $notification) {
$notifications[$key] = $this->parser->parse($this->driver['template'], $notification);
$driver = $notification['driver'];
unset($notification['driver']);
$notifications[$key] = $this->parser->parse($driver['template'], $notification);
}

if ( ! empty($notifications)) {
Expand Down Expand Up @@ -214,4 +216,4 @@ function __toString()
{
return $this->render();
}
}
}

0 comments on commit f2d4e25

Please sign in to comment.