1717use DateTimeInterface ;
1818use InvalidArgumentException ;
1919use LogicException ;
20+ use ReturnTypeWillChange ;
2021
2122/**
2223 * A `Cookie` class represents an immutable HTTP cookie value object.
@@ -562,24 +563,23 @@ public function withRaw(bool $raw = true)
562563 /**
563564 * Whether an offset exists.
564565 *
565- * @param string $offset
566- *
567- * @return bool
566+ * @param mixed $offset
568567 */
569- public function offsetExists ($ offset )
568+ public function offsetExists ($ offset ): bool
570569 {
571570 return $ offset === 'expire ' ? true : property_exists ($ this , $ offset );
572571 }
573572
574573 /**
575574 * Offset to retrieve.
576575 *
577- * @param string $offset
576+ * @param mixed $offset
578577 *
579578 * @throws InvalidArgumentException
580579 *
581580 * @return mixed
582581 */
582+ #[ReturnTypeWillChange]
583583 public function offsetGet ($ offset )
584584 {
585585 if (! $ this ->offsetExists ($ offset )) {
@@ -592,24 +592,24 @@ public function offsetGet($offset)
592592 /**
593593 * Offset to set.
594594 *
595- * @param string $offset
596- * @param mixed $value
595+ * @param mixed $offset
596+ * @param mixed $value
597597 *
598598 * @throws LogicException
599599 */
600- public function offsetSet ($ offset , $ value )
600+ public function offsetSet ($ offset , $ value ): void
601601 {
602602 throw new LogicException (sprintf ('Cannot set values of properties of %s as it is immutable. ' , static ::class));
603603 }
604604
605605 /**
606606 * Offset to unset.
607607 *
608- * @param string $offset
608+ * @param mixed $offset
609609 *
610610 * @throws LogicException
611611 */
612- public function offsetUnset ($ offset )
612+ public function offsetUnset ($ offset ): void
613613 {
614614 throw new LogicException (sprintf ('Cannot unset values of properties of %s as it is immutable. ' , static ::class));
615615 }
0 commit comments