Skip to content

Commit

Permalink
Merge pull request #18 from ericksonreyes/code-cleanup
Browse files Browse the repository at this point in the history
Clean up some codes
  • Loading branch information
ericksonreyes committed Jun 18, 2019
2 parents 25c61c5 + dde2652 commit a9e318e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/EricksonReyes/DomainDrivenDesign/Common/Mailer/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public function __construct(
EmailAddressInterface $sender,
EmailAddressInterface $recipient,
EmailBodyInterface $body
) {
)
{
$this->sender = $sender;
$this->recipients[] = $recipient;
$this->body = $body;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class PersonName implements ValueObject, HasLength
private $lastName;

/**
* @var
* @var string
*/
private $postNominals;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public static function staticEntityType(): string
/**
* @param array $array
* @return Event
* @throws \Exception
*/
public static function fromArray(array $array): Event
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ public function delete(): void
$this->additionalData()
);

if ($this->eventNeverHappened(DomainEntityWasDeletedEvent::class)) {
if ($this->isTheFirstOccurrenceOfThis($event)) {
$this->storeAndReplayThis($event);
}
if (
$this->eventNeverHappened(DomainEntityWasDeletedEvent::class) &&
$this->isTheFirstOccurrenceOfThis($event)
) {
$this->storeAndReplayThis($event);
}

if (!$this->isTheFirstOccurrenceOfThis($event)) {
Expand Down

0 comments on commit a9e318e

Please sign in to comment.