Commit dcdc50ac authored by catch's avatar catch
Browse files

Issue #3465827 by andypost, kim.pepper, arunkumark, catch, berdir, quietone:...

Issue #3465827 by andypost, kim.pepper, arunkumark, catch, berdir, quietone: Stop passing E_USER_ERROR to trigger_error() on PHP 8.4

(cherry picked from commit 3e036033)
parent bbc940fb
Loading
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -168,24 +168,24 @@ public function closing() {
  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);
      trigger_error("Reconstructed original doesn't match", E_USER_WARNING);
    }
    if (serialize($to_lines) != serialize($this->closing())) {
      trigger_error("Reconstructed closing doesn't match", E_USER_ERROR);
      trigger_error("Reconstructed closing doesn't match", E_USER_WARNING);
    }

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

    $prevtype = 'none';
    foreach ($this->edits as $edit) {
      if ( $prevtype == $edit->type ) {
        trigger_error("Edit sequence is non-optimal", E_USER_ERROR);
        trigger_error("Edit sequence is non-optimal", E_USER_WARNING);
      }
      $prevtype = $edit->type;
    }
+1 −1
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ protected function _block($xbeg, $xlen, $ybeg, $ylen, &$edits) {
        $this->_changed($edit->orig, $edit->closing);
      }
      else {
        trigger_error('Unknown edit type', E_USER_ERROR);
        trigger_error('Unknown edit type', E_USER_WARNING);
      }
    }
    $this->_end_block();
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ class DiffOp {
   */
  public function reverse() {
    @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);
    trigger_error('pure virtual', E_USER_ERROR);
    trigger_error('pure virtual', E_USER_WARNING);
  }

  /**
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ public function __toString() {
    catch (\Exception $e) {
      // User errors in __toString() methods are considered fatal in the Drupal
      // error handler.
      trigger_error(get_class($e) . ' thrown while calling __toString on a ' . static::class . ' object in ' . $e->getFile() . ' on line ' . $e->getLine() . ': ' . $e->getMessage(), E_USER_ERROR);
      trigger_error(get_class($e) . ' thrown while calling __toString on a ' . static::class . ' object in ' . $e->getFile() . ' on line ' . $e->getLine() . ': ' . $e->getMessage(), E_USER_WARNING);
      // In case we are using another error handler that did not fatal on the
      // E_USER_ERROR, we terminate execution. However, for test purposes allow
      // a return value.
+1 −1
Original line number Diff line number Diff line
@@ -265,7 +265,7 @@ public function compile(Connection $connection, PlaceholderInterface $queryPlace
            // your site is broken.
            // On top of that the database API relies on __toString() which
            // does not allow to throw exceptions.
            trigger_error('Invalid characters in query operator: ' . $condition['operator'], E_USER_ERROR);
            trigger_error('Invalid characters in query operator: ' . $condition['operator'], E_USER_WARNING);
            return;
          }

Loading