/** * {@inheritdoc} */ public function has($type) { if ($this->flashBag) { return $this->flashBag->has($type); } return array_key_exists($type, $this->flashes) && $this->flashes[$type]; }
private function add($type, $message, $domain) { if ($this->flashBag->has($this->prefix)) { $messages = $this->flashBag->get($this->prefix); } else { $messages = []; } $messages[$type][] = ['text' => $message, 'domain' => $domain]; $this->flashBag->set($this->prefix, $messages); }
public function testPeekAll() { $this->bag->set('notice', 'Foo'); $this->bag->set('error', 'Bar'); $this->assertEquals(array('notice' => array('Foo'), 'error' => array('Bar')), $this->bag->peekAll()); $this->assertTrue($this->bag->has('notice')); $this->assertTrue($this->bag->has('error')); $this->assertEquals(array('notice' => array('Foo'), 'error' => array('Bar')), $this->bag->peekAll()); }
/** * Has flash messages? * * @return bool */ public function has() { return $this->flashBag->has($this->storageKey); }