Unverified Commit 7c3b2861 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3209619 by longwave, daffie, catch: [Symfony 6] Passing null as...

Issue #3209619 by longwave, daffie, catch: [Symfony 6] Passing null as $message to Symfony exception constructors is deprecated, pass an empty string instead
parent ea56478e
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -304,10 +304,10 @@ public function orIf(AccessResultInterface $other) {
        $merge_other = TRUE;
      }

      if ($this->isForbidden() && $this instanceof AccessResultReasonInterface && !is_null($this->getReason())) {
      if ($this->isForbidden() && $this instanceof AccessResultReasonInterface && $this->getReason() !== '') {
        $result->setReason($this->getReason());
      }
      elseif ($other->isForbidden() && $other instanceof AccessResultReasonInterface && !is_null($other->getReason())) {
      elseif ($other->isForbidden() && $other instanceof AccessResultReasonInterface && $other->getReason() !== '') {
        $result->setReason($other->getReason());
      }
    }
@@ -323,10 +323,10 @@ public function orIf(AccessResultInterface $other) {
        $merge_other = TRUE;
      }

      if ($this instanceof AccessResultReasonInterface && !is_null($this->getReason())) {
      if ($this instanceof AccessResultReasonInterface && $this->getReason() !== '') {
        $result->setReason($this->getReason());
      }
      elseif ($other instanceof AccessResultReasonInterface && !is_null($other->getReason())) {
      elseif ($other instanceof AccessResultReasonInterface && $other->getReason() !== '') {
        $result->setReason($other->getReason());
      }
    }
+2 −2
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ class AccessResultForbidden extends AccessResult implements AccessResultReasonIn
  /**
   * The reason why access is forbidden. For use in error messages.
   *
   * @var string|null
   * @var string
   */
  protected $reason;

@@ -35,7 +35,7 @@ public function isForbidden() {
   * {@inheritdoc}
   */
  public function getReason() {
    return $this->reason;
    return (string) $this->reason;
  }

  /**
+2 −2
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ class AccessResultNeutral extends AccessResult implements AccessResultReasonInte
  /**
   * The reason why access is neutral. For use in messages.
   *
   * @var string|null
   * @var string
   */
  protected $reason;

@@ -35,7 +35,7 @@ public function isNeutral() {
   * {@inheritdoc}
   */
  public function getReason() {
    return $this->reason;
    return (string) $this->reason;
  }

  /**
+3 −2
Original line number Diff line number Diff line
@@ -17,8 +17,9 @@ interface AccessResultReasonInterface extends AccessResultInterface {
  /**
   * Gets the reason for this access result.
   *
   * @return string|null
   *   The reason of this access result or NULL if no reason is provided.
   * @return string
   *   The reason of this access result or an empty string if no reason is
   *   provided.
   */
  public function getReason();

+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ class BrokenPostRequestException extends BadRequestHttpException {
   * @param int $code
   *   The internal exception code.
   */
  public function __construct($max_upload_size, $message = NULL, \Exception $previous = NULL, $code = 0) {
  public function __construct($max_upload_size, $message = '', \Exception $previous = NULL, $code = 0) {
    parent::__construct($message, $previous, $code);

    $this->size = $max_upload_size;
Loading