*/ interface ICollection extends IImmutableCollection { /** * Set a value to a key * * @param array-key $key The key * @param mixed $value The value * * @psalm-param TKey $key * @psalm-param TValue $value * * @return $this */ public function set ($key, $value): self; /** * Merge one or multiple collections in the current one * * @param IImmutableCollection ...$collections The collections to merge * * @return $this */ public function merge (IImmutableCollection ...$collections): self; /** * Add one or multiple values * * @param mixed ...$values The values * * @psalm-param TValue ...$values * * @return $this */ public function add (...$values): self; /** * Add the values of one or multiple collections * * @param IImmutableCollection ...$collections The collections to add * * @return mixed */ public function addCollection (IImmutableCollection ...$collections): self; /** * Empties the collection * * @return $this */ public function clear (): self; /** * Delete a key * * @param array-key $key The key * * @psalm-param TKey $key * * @return $this */ public function remove ($key): self; /** * Delete all instances of a value * * @param mixed $value The value * @param bool $strict Strict comparison ? * * @psalm-param TValue $value * * @return $this */ public function removeValue ($value, bool $strict = false): self; }