Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MapInterface.php

function MapInterface::replaceIf

Replaces the entry for the specified key only if currently mapped to the specified value.

This performs a strict type check on the value.

Parameters

K $key The key to remove from the map.:

T $oldValue The value to match.:

T $newValue The value to use as a replacement.:

Return value

bool true if the value was replaced.

1 method overrides MapInterface::replaceIf()
AbstractMap::replaceIf in vendor/ramsey/collection/src/Map/AbstractMap.php
Replaces the entry for the specified key only if currently mapped to the specified value.

File

vendor/ramsey/collection/src/Map/MapInterface.php, line 141

Class

MapInterface
An object that maps keys to values.

Namespace

Ramsey\Collection\Map

Code

public function replaceIf(int|string $key, mixed $oldValue, mixed $newValue) : bool;

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal