MapAccess
The interface for setting and removing Map
keys (and associated values)
This interface provides no new methods as all current access for Map
s are
defined in its parent interfaces. But you could theoretically use this
interface for parameter and return type annotations.
Guides
Interface Synopsis
interface MapAccess implements ConstMapAccess<Tk, Tv>, SetAccess<Tk>, IndexAccess<Tk, Tv> {...}
Public Methods (ConstSetAccess
)
->contains(arraykey $m): bool
Checks whether a value is in the currentSet
Public Methods (ConstIndexAccess
)
->at(Tk $k): Tv
Returns the value at the specified key in the current collection->containsKey(mixed $k): bool
Determines if the specified key is in the current collection->get(Tk $k): ?Tv
Returns the value at the specified key in the current collection
Public Methods (SetAccess
)
->remove(Tm $m): this
Removes the provided value from the currentSet
Public Methods (IndexAccess
)
->removeKey(Tk $k): this
Removes the specified key (and associated value) from the current collection->set(Tk $k, Tv $v): this
Stores a value into the current collection with the specified key, overwriting the previous value associated with the key->setAll(?KeyedTraversable<Tk, Tv> $traversable): this
For every element in the providedTraversable
, stores a value into the current collection associated with each key, overwriting the previous value associated with the key