Laravel version update
Laravel version update
This commit is contained in:
@@ -17,20 +17,11 @@ namespace Symfony\Component\HttpFoundation\Session\Attribute;
|
||||
class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Countable
|
||||
{
|
||||
private $name = 'attributes';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $storageKey;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $attributes = array();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $storageKey The key used to store attributes in the session
|
||||
*/
|
||||
public function __construct($storageKey = '_sf2_attributes')
|
||||
@@ -152,6 +143,6 @@ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Counta
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
return count($this->attributes);
|
||||
return \count($this->attributes);
|
||||
}
|
||||
}
|
||||
|
@@ -19,16 +19,9 @@ namespace Symfony\Component\HttpFoundation\Session\Attribute;
|
||||
*/
|
||||
class NamespacedAttributeBag extends AttributeBag
|
||||
{
|
||||
/**
|
||||
* Namespace character.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $namespaceCharacter;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $storageKey Session storage key
|
||||
* @param string $namespaceCharacter Namespace character to use in keys
|
||||
*/
|
||||
@@ -109,7 +102,7 @@ class NamespacedAttributeBag extends AttributeBag
|
||||
protected function &resolveAttributePath($name, $writeContext = false)
|
||||
{
|
||||
$array = &$this->attributes;
|
||||
$name = (strpos($name, $this->namespaceCharacter) === 0) ? substr($name, 1) : $name;
|
||||
$name = (0 === strpos($name, $this->namespaceCharacter)) ? substr($name, 1) : $name;
|
||||
|
||||
// Check if there is anything to do, else return
|
||||
if (!$name) {
|
||||
@@ -117,7 +110,7 @@ class NamespacedAttributeBag extends AttributeBag
|
||||
}
|
||||
|
||||
$parts = explode($this->namespaceCharacter, $name);
|
||||
if (count($parts) < 2) {
|
||||
if (\count($parts) < 2) {
|
||||
if (!$writeContext) {
|
||||
return $array;
|
||||
}
|
||||
@@ -127,11 +120,17 @@ class NamespacedAttributeBag extends AttributeBag
|
||||
return $array;
|
||||
}
|
||||
|
||||
unset($parts[count($parts) - 1]);
|
||||
unset($parts[\count($parts) - 1]);
|
||||
|
||||
foreach ($parts as $part) {
|
||||
if (null !== $array && !array_key_exists($part, $array)) {
|
||||
$array[$part] = $writeContext ? array() : null;
|
||||
if (!$writeContext) {
|
||||
$null = null;
|
||||
|
||||
return $null;
|
||||
}
|
||||
|
||||
$array[$part] = array();
|
||||
}
|
||||
|
||||
$array = &$array[$part];
|
||||
|
Reference in New Issue
Block a user