1: <?php declare(strict_types=1);
2:
3: namespace Salient\Iterator\Contract;
4:
5: use Iterator;
6:
7: /**
8: * Iterates over a mutable entity while allowing the current element to be
9: * replaced
10: *
11: * @api
12: *
13: * @template TKey
14: * @template TValue
15: *
16: * @extends Iterator<TKey,TValue>
17: */
18: interface MutableIterator extends Iterator
19: {
20: /**
21: * Replace the current element
22: *
23: * @param TValue $value
24: * @return $this
25: */
26: public function replace($value);
27: }
28: