Пример #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];
 }
Пример #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);
 }
Пример #3
0
 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());
 }
Пример #4
0
 /**
  * Has flash messages?
  *
  * @return bool
  */
 public function has()
 {
     return $this->flashBag->has($this->storageKey);
 }