upgraded dependencies

This commit is contained in:
RafficMohammed
2023-01-08 01:59:16 +05:30
parent 51056e3aad
commit f9ae387337
6895 changed files with 133617 additions and 178680 deletions

View File

@@ -13,6 +13,8 @@ namespace Symfony\Component\HttpFoundation\Session\Attribute;
/**
* This class relates to session attribute storage.
*
* @implements \IteratorAggregate<string, mixed>
*/
class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Countable
{
@@ -37,7 +39,7 @@ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Counta
return $this->name;
}
public function setName($name)
public function setName(string $name)
{
$this->name = $name;
}
@@ -61,7 +63,7 @@ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Counta
/**
* {@inheritdoc}
*/
public function has($name)
public function has(string $name)
{
return \array_key_exists($name, $this->attributes);
}
@@ -69,7 +71,7 @@ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Counta
/**
* {@inheritdoc}
*/
public function get($name, $default = null)
public function get(string $name, $default = null)
{
return \array_key_exists($name, $this->attributes) ? $this->attributes[$name] : $default;
}
@@ -77,7 +79,7 @@ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Counta
/**
* {@inheritdoc}
*/
public function set($name, $value)
public function set(string $name, $value)
{
$this->attributes[$name] = $value;
}
@@ -104,7 +106,7 @@ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Counta
/**
* {@inheritdoc}
*/
public function remove($name)
public function remove(string $name)
{
$retval = null;
if (\array_key_exists($name, $this->attributes)) {
@@ -129,7 +131,7 @@ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Counta
/**
* Returns an iterator for attributes.
*
* @return \ArrayIterator An \ArrayIterator instance
* @return \ArrayIterator<string, mixed>
*/
#[\ReturnTypeWillChange]
public function getIterator()
@@ -140,7 +142,7 @@ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Counta
/**
* Returns the number of attributes.
*
* @return int The number of attributes
* @return int
*/
#[\ReturnTypeWillChange]
public function count()

View File

@@ -23,34 +23,30 @@ interface AttributeBagInterface extends SessionBagInterface
/**
* Checks if an attribute is defined.
*
* @param string $name The attribute name
*
* @return bool true if the attribute is defined, false otherwise
* @return bool
*/
public function has($name);
public function has(string $name);
/**
* Returns an attribute.
*
* @param string $name The attribute name
* @param mixed $default The default value if not found
* @param mixed $default The default value if not found
*
* @return mixed
*/
public function get($name, $default = null);
public function get(string $name, $default = null);
/**
* Sets an attribute.
*
* @param string $name
* @param mixed $value
* @param mixed $value
*/
public function set($name, $value);
public function set(string $name, $value);
/**
* Returns attributes.
*
* @return array
* @return array<string, mixed>
*/
public function all();
@@ -59,9 +55,7 @@ interface AttributeBagInterface extends SessionBagInterface
/**
* Removes an attribute.
*
* @param string $name
*
* @return mixed The removed value or null when it does not exist
*/
public function remove($name);
public function remove(string $name);
}

View File

@@ -11,11 +11,15 @@
namespace Symfony\Component\HttpFoundation\Session\Attribute;
trigger_deprecation('symfony/http-foundation', '5.3', 'The "%s" class is deprecated.', NamespacedAttributeBag::class);
/**
* This class provides structured storage of session attributes using
* a name spacing character in the key.
*
* @author Drak <drak@zikula.org>
*
* @deprecated since Symfony 5.3
*/
class NamespacedAttributeBag extends AttributeBag
{
@@ -34,7 +38,7 @@ class NamespacedAttributeBag extends AttributeBag
/**
* {@inheritdoc}
*/
public function has($name)
public function has(string $name)
{
// reference mismatch: if fixed, re-introduced in array_key_exists; keep as it is
$attributes = $this->resolveAttributePath($name);
@@ -50,7 +54,7 @@ class NamespacedAttributeBag extends AttributeBag
/**
* {@inheritdoc}
*/
public function get($name, $default = null)
public function get(string $name, $default = null)
{
// reference mismatch: if fixed, re-introduced in array_key_exists; keep as it is
$attributes = $this->resolveAttributePath($name);
@@ -66,7 +70,7 @@ class NamespacedAttributeBag extends AttributeBag
/**
* {@inheritdoc}
*/
public function set($name, $value)
public function set(string $name, $value)
{
$attributes = &$this->resolveAttributePath($name, true);
$name = $this->resolveKey($name);
@@ -76,7 +80,7 @@ class NamespacedAttributeBag extends AttributeBag
/**
* {@inheritdoc}
*/
public function remove($name)
public function remove(string $name)
{
$retval = null;
$attributes = &$this->resolveAttributePath($name);
@@ -99,7 +103,7 @@ class NamespacedAttributeBag extends AttributeBag
*
* @return array|null
*/
protected function &resolveAttributePath($name, $writeContext = false)
protected function &resolveAttributePath(string $name, bool $writeContext = false)
{
$array = &$this->attributes;
$name = (str_starts_with($name, $this->namespaceCharacter)) ? substr($name, 1) : $name;
@@ -144,11 +148,9 @@ class NamespacedAttributeBag extends AttributeBag
*
* This is the last part in a dot separated string.
*
* @param string $name
*
* @return string
*/
protected function resolveKey($name)
protected function resolveKey(string $name)
{
if (false !== $pos = strrpos($name, $this->namespaceCharacter)) {
$name = substr($name, $pos + 1);