-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 6.4: [Messenger] Don't drop stamps when message validation fails [WebProfilerBundle] Fix assignment to constant variable [Mailer] [Sendgrid] Use DataPart::getContentId() when DataPart::setContentId() is used.
- Loading branch information
Showing
8 changed files
with
147 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,12 +19,12 @@ | |
* | ||
* @author Tobias Nyholm <[email protected]> | ||
*/ | ||
class DelayedMessageHandlingException extends RuntimeException implements WrappedExceptionsInterface | ||
class DelayedMessageHandlingException extends RuntimeException implements WrappedExceptionsInterface, EnvelopeAwareExceptionInterface | ||
{ | ||
use EnvelopeAwareExceptionTrait; | ||
use WrappedExceptionsTrait; | ||
|
||
private array $exceptions; | ||
private ?Envelope $envelope; | ||
|
||
public function __construct(array $exceptions, ?Envelope $envelope = null) | ||
{ | ||
|
@@ -45,9 +45,4 @@ public function __construct(array $exceptions, ?Envelope $envelope = null) | |
|
||
parent::__construct($message, 0, $exceptions[array_key_first($exceptions)]); | ||
} | ||
|
||
public function getEnvelope(): ?Envelope | ||
{ | ||
return $this->envelope; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Messenger\Exception; | ||
|
||
use Symfony\Component\Messenger\Envelope; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
interface EnvelopeAwareExceptionInterface | ||
{ | ||
public function getEnvelope(): ?Envelope; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Messenger\Exception; | ||
|
||
use Symfony\Component\Messenger\Envelope; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
trait EnvelopeAwareExceptionTrait | ||
{ | ||
private ?Envelope $envelope = null; | ||
|
||
public function getEnvelope(): ?Envelope | ||
{ | ||
return $this->envelope; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,20 +11,24 @@ | |
|
||
namespace Symfony\Component\Messenger\Exception; | ||
|
||
use Symfony\Component\Messenger\Envelope; | ||
use Symfony\Component\Validator\ConstraintViolationListInterface; | ||
|
||
/** | ||
* @author Tobias Nyholm <[email protected]> | ||
*/ | ||
class ValidationFailedException extends RuntimeException | ||
class ValidationFailedException extends RuntimeException implements EnvelopeAwareExceptionInterface | ||
{ | ||
use EnvelopeAwareExceptionTrait; | ||
|
||
private ConstraintViolationListInterface $violations; | ||
private object $violatingMessage; | ||
|
||
public function __construct(object $violatingMessage, ConstraintViolationListInterface $violations) | ||
public function __construct(object $violatingMessage, ConstraintViolationListInterface $violations, ?Envelope $envelope = null) | ||
{ | ||
$this->violatingMessage = $violatingMessage; | ||
$this->violations = $violations; | ||
$this->envelope = $envelope; | ||
|
||
parent::__construct(sprintf('Message of type "%s" failed validation.', $this->violatingMessage::class)); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters