function AbstractMap::get
Parameters
K $key The key to return from the map.:
T | null $defaultValue The default value to use if `$key` is not found.:
Return value
T | null the value or `null` if the key could not be found.
Overrides MapInterface::get
6 calls to AbstractMap::get()
- AbstractMap::put in vendor/
ramsey/ collection/ src/ Map/ AbstractMap.php - AbstractMap::putIfAbsent in vendor/
ramsey/ collection/ src/ Map/ AbstractMap.php - AbstractMap::remove in vendor/
ramsey/ collection/ src/ Map/ AbstractMap.php - AbstractMap::removeIf in vendor/
ramsey/ collection/ src/ Map/ AbstractMap.php - Removes the entry for the specified key only if it is currently mapped to the specified value.
- AbstractMap::replace in vendor/
ramsey/ collection/ src/ Map/ AbstractMap.php
File
-
vendor/
ramsey/ collection/ src/ Map/ AbstractMap.php, line 96
Class
- AbstractMap
- This class provides a basic implementation of `MapInterface`, to minimize the effort required to implement this interface.
Namespace
Ramsey\Collection\MapCode
public function get(int|string $key, mixed $defaultValue = null) : mixed {
return $this[$key] ?? $defaultValue;
}