mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Fix #19041: Fix PHP 8.1 issues
This commit is contained in:

committed by
GitHub

parent
4bd551d143
commit
1271bc419f
@ -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);
|
||||
|
Reference in New Issue
Block a user