This repository has been archived by the owner on May 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup and prepare for release (#2)
* Clean up events * Added changelog and metadata
- Loading branch information
Showing
11 changed files
with
131 additions
and
79 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in(__DIR__.'/src') | ||
; | ||
|
||
return PhpCsFixer\Config::create() | ||
->setRiskyAllowed(true) | ||
->setRules([ | ||
'@Symfony' => true, | ||
'no_superfluous_phpdoc_tags' => true, | ||
'final_class' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
]) | ||
->setFinder($finder) | ||
; |
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,5 @@ | ||
# Change Log | ||
|
||
## 0.2.0 | ||
|
||
- Initial release |
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
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 |
---|---|---|
|
@@ -4,13 +4,14 @@ | |
|
||
namespace Bref\MessengerSns\Event; | ||
|
||
use Symfony\Component\Messenger\Envelope; | ||
use Symfony\Component\Messenger\Event\WorkerMessageFailedEvent; | ||
use Symfony\Component\Messenger\Event\WorkerMessageReceivedEvent; | ||
|
||
class SnsMessageDecodeFailed | ||
/** | ||
* Thrown when a SNS event could not be decoded. | ||
* | ||
* @author Tobias Nyholm <[email protected]> | ||
*/ | ||
final class SnsMessageDecodeFailed | ||
{ | ||
use SnsMessageTrait; | ||
private $snsEvent; | ||
private $throwable; | ||
private $receiverName; | ||
|
||
|
@@ -21,6 +22,11 @@ public function __construct(array $snsEvent, \Throwable $throwable, string $rece | |
$this->receiverName = $receiverName; | ||
} | ||
|
||
public function getSnsEvent(): array | ||
{ | ||
return $this->snsEvent; | ||
} | ||
|
||
public function getThrowable(): \Throwable | ||
{ | ||
return $this->throwable; | ||
|
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 |
---|---|---|
|
@@ -5,17 +5,44 @@ | |
namespace Bref\MessengerSns\Event; | ||
|
||
use Symfony\Component\Messenger\Envelope; | ||
use Symfony\Component\Messenger\Event\WorkerMessageFailedEvent; | ||
use Symfony\Component\Messenger\Event\WorkerMessageReceivedEvent; | ||
|
||
class SnsMessageFailed extends WorkerMessageFailedEvent | ||
/** | ||
* An SNS messages failed to be handled properly. Subscribers to this event should handle retry. | ||
* | ||
* @author Tobias Nyholm <[email protected]> | ||
*/ | ||
final class SnsMessageFailed | ||
{ | ||
use SnsMessageTrait; | ||
private $snsEvent; | ||
private $envelope; | ||
private $receiverName; | ||
private $throwable; | ||
|
||
public function __construct(array $snsEvent, Envelope $envelope, string $receiverName, \Throwable $error, bool $willRetry) | ||
public function __construct(array $snsEvent, Envelope $envelope, string $receiverName, \Throwable $error) | ||
{ | ||
$this->snsEvent = $snsEvent; | ||
$this->envelope = $envelope; | ||
$this->receiverName = $receiverName; | ||
$this->throwable = $error; | ||
} | ||
|
||
public function getSnsEvent(): array | ||
{ | ||
return $this->snsEvent; | ||
} | ||
|
||
parent::__construct($envelope, $receiverName, $error, $willRetry); | ||
public function getEnvelope(): Envelope | ||
{ | ||
return $this->envelope; | ||
} | ||
|
||
public function getReceiverName(): string | ||
{ | ||
return $this->receiverName; | ||
} | ||
|
||
public function getThrowable(): \Throwable | ||
{ | ||
return $this->throwable; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -4,16 +4,39 @@ | |
|
||
namespace Bref\MessengerSns\Event; | ||
|
||
use Symfony\Component\Messenger\Envelope; | ||
use Symfony\Component\Messenger\Event\WorkerMessageReceivedEvent; | ||
|
||
class SnsMessageReceived extends WorkerMessageReceivedEvent | ||
/** | ||
* A raw SNS message was received. Use this event to decide if we want to handle this SNS message or not. | ||
* | ||
* @author Tobias Nyholm <[email protected]> | ||
*/ | ||
final class SnsMessageReceived | ||
{ | ||
use SnsMessageTrait; | ||
private $snsEvent; | ||
private $receiverName; | ||
private $shouldHandle = true; | ||
|
||
public function __construct(array $snsEvent, Envelope $envelope, string $receiverName) | ||
public function __construct(array $snsEvent, string $receiverName) | ||
{ | ||
$this->receiverName = $receiverName; | ||
$this->snsEvent = $snsEvent; | ||
parent::__construct($envelope, $receiverName); | ||
} | ||
|
||
public function shouldHandle(bool $shouldHandle = null): bool | ||
{ | ||
if (null !== $shouldHandle) { | ||
$this->shouldHandle = $shouldHandle; | ||
} | ||
|
||
return $this->shouldHandle; | ||
} | ||
|
||
public function getSnsEvent(): array | ||
{ | ||
return $this->snsEvent; | ||
} | ||
|
||
public function getReceiverName(): string | ||
{ | ||
return $this->receiverName; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.