Updated Symfony HttpFoundation to 2.1.6.

This commit is contained in:
Taylor Otwell
2013-01-06 13:58:32 -06:00
parent f754e1fa55
commit cb567c5e4d
55 changed files with 1758 additions and 805 deletions

View File

@@ -75,7 +75,15 @@ class AutoExpireFlashBag implements FlashBagInterface
/**
* {@inheritdoc}
*/
public function peek($type, $default = null)
public function add($type, $message)
{
$this->flashes['new'][$type][] = $message;
}
/**
* {@inheritdoc}
*/
public function peek($type, array $default = array())
{
return $this->has($type) ? $this->flashes['display'][$type] : $default;
}
@@ -85,13 +93,13 @@ class AutoExpireFlashBag implements FlashBagInterface
*/
public function peekAll()
{
return array_key_exists('display', $this->flashes) ? (array)$this->flashes['display'] : array();
return array_key_exists('display', $this->flashes) ? (array) $this->flashes['display'] : array();
}
/**
* {@inheritdoc}
*/
public function get($type, $default = null)
public function get($type, array $default = array())
{
$return = $default;
@@ -129,9 +137,9 @@ class AutoExpireFlashBag implements FlashBagInterface
/**
* {@inheritdoc}
*/
public function set($type, $message)
public function set($type, $messages)
{
$this->flashes['new'][$type] = $message;
$this->flashes['new'][$type] = (array) $messages;
}
/**
@@ -139,7 +147,7 @@ class AutoExpireFlashBag implements FlashBagInterface
*/
public function has($type)
{
return array_key_exists($type, $this->flashes['display']);
return array_key_exists($type, $this->flashes['display']) && $this->flashes['display'][$type];
}
/**
@@ -163,9 +171,6 @@ class AutoExpireFlashBag implements FlashBagInterface
*/
public function clear()
{
$return = $this->all();
$this->flashes = array('display' => array(), 'new' => array());
return $return;
return $this->all();
}
}