-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
226 additions
and
52 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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace Enqueue\Client; | ||
|
||
trait EmptyExtensionTrait | ||
{ | ||
public function onPrepareEventBody(PrepareBody $event): void | ||
{ | ||
} | ||
|
||
public function onPrepareCommandBody(PrepareBody $event): void | ||
{ | ||
} | ||
|
||
public function onPreSendEvent(PreSend $event): void | ||
{ | ||
} | ||
|
||
public function onPreSendCommand(PreSend $event): void | ||
{ | ||
} | ||
|
||
public function onPostSendEvent(PostSend $event): void | ||
{ | ||
} | ||
|
||
public function onPostSendCommand(PostSend $event): void | ||
{ | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Enqueue\Client; | ||
|
||
class PostSend | ||
{ | ||
private $message; | ||
|
||
public function __construct(Message $message) | ||
{ | ||
$this->message = $message; | ||
} | ||
|
||
public function getMessage(): Message | ||
{ | ||
return $this->message; | ||
} | ||
|
||
public function isEvent(): bool | ||
{ | ||
return Config::COMMAND_TOPIC !== $this->message->getProperty(Config::PARAMETER_TOPIC_NAME); | ||
} | ||
|
||
public function getCommand(): string | ||
{ | ||
return $this->message->getProperty(Config::PARAMETER_COMMAND_NAME); | ||
} | ||
|
||
public function getTopic(): string | ||
{ | ||
return $this->message->getProperty(Config::PARAMETER_TOPIC_NAME); | ||
} | ||
} |
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,33 @@ | ||
<?php | ||
|
||
namespace Enqueue\Client; | ||
|
||
class PreSend | ||
{ | ||
private $message; | ||
|
||
public function __construct(Message $message) | ||
{ | ||
$this->message = $message; | ||
} | ||
|
||
public function getMessage(): Message | ||
{ | ||
return $this->message; | ||
} | ||
|
||
public function isEvent(): bool | ||
{ | ||
return Config::COMMAND_TOPIC !== $this->message->getProperty(Config::PARAMETER_TOPIC_NAME); | ||
} | ||
|
||
public function getCommand(): string | ||
{ | ||
return $this->message->getProperty(Config::PARAMETER_COMMAND_NAME); | ||
} | ||
|
||
public function getTopic(): string | ||
{ | ||
return $this->message->getProperty(Config::PARAMETER_TOPIC_NAME); | ||
} | ||
} |
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,47 @@ | ||
<?php | ||
|
||
namespace Enqueue\Client; | ||
|
||
class PrepareBody | ||
{ | ||
private $message; | ||
|
||
private $body; | ||
|
||
private $command; | ||
|
||
private $topic; | ||
|
||
public function __construct(Message $message, $body, string $command = null, string $topic = null) | ||
{ | ||
$this->message = $message; | ||
$this->body = $body; | ||
$this->command = $command; | ||
$this->topic = $topic; | ||
} | ||
|
||
public function getMessage(): Message | ||
{ | ||
return $this->message; | ||
} | ||
|
||
public function getBody() | ||
{ | ||
return $this->body; | ||
} | ||
|
||
public function setBody($body): void | ||
{ | ||
$this->body = $body; | ||
} | ||
|
||
public function getCommand(): string | ||
{ | ||
return $this->command; | ||
} | ||
|
||
public function getTopic(): string | ||
{ | ||
return $this->topic; | ||
} | ||
} |
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