Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function has($type)
 {
     if ($this->flashBag) {
         return $this->flashBag->has($type);
     }
     return array_key_exists($type, $this->flashes) && $this->flashes[$type];
 }
Exemple #2
0
 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());
 }
Exemple #4
0
 /**
  * Has flash messages?
  *
  * @return bool
  */
 public function has()
 {
     return $this->flashBag->has($this->storageKey);
 }