17
17
use DateTimeInterface ;
18
18
use InvalidArgumentException ;
19
19
use LogicException ;
20
+ use ReturnTypeWillChange ;
20
21
21
22
/**
22
23
* A `Cookie` class represents an immutable HTTP cookie value object.
@@ -562,24 +563,23 @@ public function withRaw(bool $raw = true)
562
563
/**
563
564
* Whether an offset exists.
564
565
*
565
- * @param string $offset
566
- *
567
- * @return bool
566
+ * @param mixed $offset
568
567
*/
569
- public function offsetExists ($ offset )
568
+ public function offsetExists ($ offset ): bool
570
569
{
571
570
return $ offset === 'expire ' ? true : property_exists ($ this , $ offset );
572
571
}
573
572
574
573
/**
575
574
* Offset to retrieve.
576
575
*
577
- * @param string $offset
576
+ * @param mixed $offset
578
577
*
579
578
* @throws InvalidArgumentException
580
579
*
581
580
* @return mixed
582
581
*/
582
+ #[ReturnTypeWillChange]
583
583
public function offsetGet ($ offset )
584
584
{
585
585
if (! $ this ->offsetExists ($ offset )) {
@@ -592,24 +592,24 @@ public function offsetGet($offset)
592
592
/**
593
593
* Offset to set.
594
594
*
595
- * @param string $offset
596
- * @param mixed $value
595
+ * @param mixed $offset
596
+ * @param mixed $value
597
597
*
598
598
* @throws LogicException
599
599
*/
600
- public function offsetSet ($ offset , $ value )
600
+ public function offsetSet ($ offset , $ value ): void
601
601
{
602
602
throw new LogicException (sprintf ('Cannot set values of properties of %s as it is immutable. ' , static ::class));
603
603
}
604
604
605
605
/**
606
606
* Offset to unset.
607
607
*
608
- * @param string $offset
608
+ * @param mixed $offset
609
609
*
610
610
* @throws LogicException
611
611
*/
612
- public function offsetUnset ($ offset )
612
+ public function offsetUnset ($ offset ): void
613
613
{
614
614
throw new LogicException (sprintf ('Cannot unset values of properties of %s as it is immutable. ' , static ::class));
615
615
}
0 commit comments