updated-packages
This commit is contained in:
@@ -19,7 +19,7 @@ namespace Symfony\Component\HttpFoundation\Session\Flash;
|
||||
class AutoExpireFlashBag implements FlashBagInterface
|
||||
{
|
||||
private $name = 'flashes';
|
||||
private $flashes = array('display' => array(), 'new' => array());
|
||||
private $flashes = ['display' => [], 'new' => []];
|
||||
private $storageKey;
|
||||
|
||||
/**
|
||||
@@ -53,8 +53,8 @@ class AutoExpireFlashBag implements FlashBagInterface
|
||||
// The logic: messages from the last request will be stored in new, so we move them to previous
|
||||
// This request we will show what is in 'display'. What is placed into 'new' this time round will
|
||||
// be moved to display next time round.
|
||||
$this->flashes['display'] = array_key_exists('new', $this->flashes) ? $this->flashes['new'] : array();
|
||||
$this->flashes['new'] = array();
|
||||
$this->flashes['display'] = \array_key_exists('new', $this->flashes) ? $this->flashes['new'] : [];
|
||||
$this->flashes['new'] = [];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,7 +68,7 @@ class AutoExpireFlashBag implements FlashBagInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function peek($type, array $default = array())
|
||||
public function peek($type, array $default = [])
|
||||
{
|
||||
return $this->has($type) ? $this->flashes['display'][$type] : $default;
|
||||
}
|
||||
@@ -78,13 +78,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) ? $this->flashes['display'] : [];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get($type, array $default = array())
|
||||
public function get($type, array $default = [])
|
||||
{
|
||||
$return = $default;
|
||||
|
||||
@@ -106,7 +106,7 @@ class AutoExpireFlashBag implements FlashBagInterface
|
||||
public function all()
|
||||
{
|
||||
$return = $this->flashes['display'];
|
||||
$this->flashes['display'] = array();
|
||||
$this->flashes['display'] = [];
|
||||
|
||||
return $return;
|
||||
}
|
||||
@@ -132,7 +132,7 @@ class AutoExpireFlashBag implements FlashBagInterface
|
||||
*/
|
||||
public function has($type)
|
||||
{
|
||||
return array_key_exists($type, $this->flashes['display']) && $this->flashes['display'][$type];
|
||||
return \array_key_exists($type, $this->flashes['display']) && $this->flashes['display'][$type];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -19,7 +19,7 @@ namespace Symfony\Component\HttpFoundation\Session\Flash;
|
||||
class FlashBag implements FlashBagInterface
|
||||
{
|
||||
private $name = 'flashes';
|
||||
private $flashes = array();
|
||||
private $flashes = [];
|
||||
private $storageKey;
|
||||
|
||||
/**
|
||||
@@ -62,7 +62,7 @@ class FlashBag implements FlashBagInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function peek($type, array $default = array())
|
||||
public function peek($type, array $default = [])
|
||||
{
|
||||
return $this->has($type) ? $this->flashes[$type] : $default;
|
||||
}
|
||||
@@ -78,7 +78,7 @@ class FlashBag implements FlashBagInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get($type, array $default = array())
|
||||
public function get($type, array $default = [])
|
||||
{
|
||||
if (!$this->has($type)) {
|
||||
return $default;
|
||||
@@ -97,7 +97,7 @@ class FlashBag implements FlashBagInterface
|
||||
public function all()
|
||||
{
|
||||
$return = $this->peekAll();
|
||||
$this->flashes = array();
|
||||
$this->flashes = [];
|
||||
|
||||
return $return;
|
||||
}
|
||||
@@ -123,7 +123,7 @@ class FlashBag implements FlashBagInterface
|
||||
*/
|
||||
public function has($type)
|
||||
{
|
||||
return array_key_exists($type, $this->flashes) && $this->flashes[$type];
|
||||
return \array_key_exists($type, $this->flashes) && $this->flashes[$type];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -21,7 +21,7 @@ use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
|
||||
interface FlashBagInterface extends SessionBagInterface
|
||||
{
|
||||
/**
|
||||
* Adds a flash message for type.
|
||||
* Adds a flash message for the given type.
|
||||
*
|
||||
* @param string $type
|
||||
* @param mixed $message
|
||||
@@ -29,12 +29,12 @@ interface FlashBagInterface extends SessionBagInterface
|
||||
public function add($type, $message);
|
||||
|
||||
/**
|
||||
* Registers a message for a given type.
|
||||
* Registers one or more messages for a given type.
|
||||
*
|
||||
* @param string $type
|
||||
* @param string|array $message
|
||||
* @param string|array $messages
|
||||
*/
|
||||
public function set($type, $message);
|
||||
public function set($type, $messages);
|
||||
|
||||
/**
|
||||
* Gets flash messages for a given type.
|
||||
@@ -44,7 +44,7 @@ interface FlashBagInterface extends SessionBagInterface
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function peek($type, array $default = array());
|
||||
public function peek($type, array $default = []);
|
||||
|
||||
/**
|
||||
* Gets all flash messages.
|
||||
@@ -61,7 +61,7 @@ interface FlashBagInterface extends SessionBagInterface
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get($type, array $default = array());
|
||||
public function get($type, array $default = []);
|
||||
|
||||
/**
|
||||
* Gets and clears flashes from the stack.
|
||||
|
Reference in New Issue
Block a user