Fix #19041: Fix PHP 8.1 issues

This commit is contained in:
Alexander Makarov
2022-01-14 13:52:01 +03:00
committed by GitHub
parent 4bd551d143
commit 1271bc419f
49 changed files with 162 additions and 53 deletions

View File

@ -54,6 +54,7 @@ class CookieCollection extends BaseObject implements \IteratorAggregate, \ArrayA
* It will be implicitly called when you use `foreach` to traverse the collection.
* @return ArrayIterator an iterator for traversing the cookies in the collection.
*/
#[\ReturnTypeWillChange]
public function getIterator()
{
return new ArrayIterator($this->_cookies);
@ -65,6 +66,7 @@ class CookieCollection extends BaseObject implements \IteratorAggregate, \ArrayA
* It will be implicitly called when you use `count($collection)`.
* @return int the number of cookies in the collection.
*/
#[\ReturnTypeWillChange]
public function count()
{
return $this->getCount();
@ -198,6 +200,7 @@ class CookieCollection extends BaseObject implements \IteratorAggregate, \ArrayA
* @param string $name the cookie name
* @return bool whether the named cookie exists
*/
#[\ReturnTypeWillChange]
public function offsetExists($name)
{
return $this->has($name);
@ -211,6 +214,7 @@ class CookieCollection extends BaseObject implements \IteratorAggregate, \ArrayA
* @param string $name the cookie name
* @return Cookie the cookie with the specified name, null if the named cookie does not exist.
*/
#[\ReturnTypeWillChange]
public function offsetGet($name)
{
return $this->get($name);
@ -224,6 +228,7 @@ class CookieCollection extends BaseObject implements \IteratorAggregate, \ArrayA
* @param string $name the cookie name
* @param Cookie $cookie the cookie to be added
*/
#[\ReturnTypeWillChange]
public function offsetSet($name, $cookie)
{
$this->add($cookie);
@ -236,6 +241,7 @@ class CookieCollection extends BaseObject implements \IteratorAggregate, \ArrayA
* This is equivalent to [[remove()]].
* @param string $name the cookie name
*/
#[\ReturnTypeWillChange]
public function offsetUnset($name)
{
$this->remove($name);