original_string: public function replace($oldValue, $newValue)
      {
          if (!is_string($oldValue)) {
              throw new UnexpectedTypeException($oldValue, 'string', 'oldValue');
          }
          if (empty($oldValue)) {
              return;
          }
          if (!is_string($newValue) && null !== $newValue) {
              throw new UnexpectedTypeException($newValue, 'string or null', 'newValue');
          }
  
          $key = array_search($oldValue, $this->values, true);
          if (false !== $key) {
              if (empty($newValue)) {
                  unset($this->values[$key]);
              } else {
                  $this->values[$key] = $newValue;
              }
          }
      }
code: public function replace($oldValue, $newValue)
      {
          if (!is_string($oldValue)) {
              throw new UnexpectedTypeException($oldValue, 'string', 'oldValue');
          }
          if (empty($oldValue)) {
              return;
          }
          if (!is_string($newValue) && null !== $newValue) {
              throw new UnexpectedTypeException($newValue, 'string or null', 'newValue');
          }
  
          $key = array_search($oldValue, $this->values, true);
          if (false !== $key) {
              if (empty($newValue)) {
                  unset($this->values[$key]);
              } else {
                  $this->values[$key] = $newValue;
              }
          }
      }
code_tokens: public function replace ( $ oldValue , $ newValue ) { if ( ! is_string ( $ oldValue ) ) { throw new UnexpectedTypeException ( $ oldValue , 'string' , 'oldValue' ) ; } if ( empty ( $ oldValue ) ) { return ; } if ( ! is_string ( $ newValue ) && null !== $ newValue ) { throw new UnexpectedTypeException ( $ newValue , 'string or null' , 'newValue' ) ; } $ key = array_search ( $ oldValue , $ this -> values , true ) ; if ( false !== $ key ) { if ( empty ( $ newValue ) ) { unset ( $ this -> values [ $ key ] ) ; } else { $ this -> values [ $ key ] = $ newValue ; } } }
docstring: Requests to replace one value with another value
  
  @param string      $oldValue
  @param string|null $newValue
docstring_tokens: Requests to replace one value with another value