Skip to content

Commit

Permalink
make MemoryQueueClient::$memory as public
Browse files Browse the repository at this point in the history
  • Loading branch information
bartoszwidera committed Feb 29, 2024
1 parent fd6bfbd commit ac8ee0b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 23 deletions.
16 changes: 0 additions & 16 deletions src/Aws/Sqs/SqsQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,4 @@ public function getMessages(int $numberOfMessages = 10): array

return [];
}

public function getAllMessages(): array
{
$response = $this->client->receiveMessage([
'QueueUrl' => sprintf('%s/%s', $this->queueEndpoint, $this->queueName),
]);

if (is_array($response->search('Messages'))) {
return array_map(
static fn ($message) => $message['Body'],
$response->search('Messages')
);
}

return [];
}
}
7 changes: 1 addition & 6 deletions src/Memory/Queue/MemoryQueueClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

final class MemoryQueueClient implements QueueClient, Countable
{
private array $memory = [];
public array $memory = [];

public function sendMessage(Message $message, MessageMetadata $metadata): void
{
Expand All @@ -31,9 +31,4 @@ public function getMessages(int $numberOfMessages = 10): array
{
return array_splice($this->memory, 0, $numberOfMessages);
}

public function getAllMessages(): array
{
return $this->memory;
}
}
1 change: 0 additions & 1 deletion src/Queue/QueueClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ interface QueueClient
{
public function sendMessage(Message $message, MessageMetadata $metadata): void;
public function getMessages(int $numberOfMessages = 10): array;
public function getAllMessages(): array;
}

0 comments on commit ac8ee0b

Please sign in to comment.