closing example


  }

  /** * {@inheritdoc} */
  protected function _changed($orig$closing) {
    $orig = array_map('\Drupal\Component\Utility\Html::escape', $orig);
    $closing = array_map('\Drupal\Component\Utility\Html::escape', $closing);
    $diff = new WordLevelDiff($orig$closing);
    $del = $diff->orig();
    $add = $diff->closing();

    // Notice that WordLevelDiff returns HTML-escaped output. Hence, we will be     // calling addedLine/deletedLine without HTML-escaping.     while ($line = array_shift($del)) {
      $aline = array_shift($add);
      $this->rows[] = array_merge($this->deletedLine($line)isset($aline) ? $this->addedLine($aline) : $this->emptyLine());
    }

    // If any leftovers.     foreach ($add as $line) {
      $this->rows[] = array_merge($this->emptyLine()$this->addedLine($line));
    }

  public function check($from_lines$to_lines) {
    @trigger_error(__METHOD__ . '() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3337942', E_USER_DEPRECATED);
    if (serialize($from_lines) != serialize($this->orig())) {
      trigger_error("Reconstructed original doesn't match", E_USER_ERROR);
    }
    if (serialize($to_lines) != serialize($this->closing())) {
      trigger_error("Reconstructed closing doesn't match", E_USER_ERROR);
    }

    $rev = $this->reverse();
    if (serialize($to_lines) != serialize($rev->orig())) {
      trigger_error("Reversed original doesn't match", E_USER_ERROR);
    }
    if (serialize($from_lines) != serialize($rev->closing())) {
      trigger_error("Reversed closing doesn't match", E_USER_ERROR);
    }

    
Home | Imprint | This part of the site doesn't use cookies.