Skip to content
Snippets Groups Projects
Commit c45c05ac authored by David Prévot's avatar David Prévot
Browse files

New upstream version 1.7.5

parents 88a6e3b4 67671771
Branches
Tags upstream/1.7.5
No related merge requests found
Pipeline #786736 failed
......@@ -12,7 +12,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
......
......@@ -23,7 +23,7 @@ jobs:
coverage: none
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Initialize tests
run: make initialize
......
......@@ -2,6 +2,13 @@
## NOT RELEASED
## 1.7.5
### Changed
- use strict comparison `null !==` instead of `!`
- AWS enhancement: Documentation updates.
## 1.7.4
### Changed
......
......@@ -54,11 +54,8 @@ final class CreateTopicInput extends Input
*
* The following attributes apply only to FIFO topics [^4]:
*
* - `ArchivePolicy` – Adds or updates an inline policy document to archive messages stored in the specified Amazon
* SNS topic.
* - `BeginningArchiveTime` – The earliest starting point at which a message in the topic’s archive can be replayed
* from. This point in time is based on the configured message retention period set by the topic’s message archiving
* policy.
* - `ArchivePolicy` – The policy that sets the retention period for messages stored in the message archive of an
* Amazon SNS FIFO topic.
* - `ContentBasedDeduplication` – Enables content-based deduplication for FIFO topics.
*
* - By default, `ContentBasedDeduplication` is set to `false`. If you create a FIFO topic and this attribute is
......
......@@ -29,6 +29,6 @@ class CreateEndpointResponse extends Result
$data = new \SimpleXMLElement($response->getContent());
$data = $data->CreatePlatformEndpointResult;
$this->endpointArn = ($v = $data->EndpointArn) ? (string) $v : null;
$this->endpointArn = (null !== $v = $data->EndpointArn[0]) ? (string) $v : null;
}
}
......@@ -29,6 +29,6 @@ class CreateTopicResponse extends Result
$data = new \SimpleXMLElement($response->getContent());
$data = $data->CreateTopicResult;
$this->topicArn = ($v = $data->TopicArn) ? (string) $v : null;
$this->topicArn = (null !== $v = $data->TopicArn[0]) ? (string) $v : null;
}
}
......@@ -73,7 +73,7 @@ class ListSubscriptionsByTopicResponse extends Result implements \IteratorAggreg
$page = $this;
while (true) {
$page->initialize();
if ($page->nextToken) {
if (null !== $page->nextToken) {
$input->setNextToken($page->nextToken);
$this->registerPrefetch($nextPage = $client->listSubscriptionsByTopic($input));
......@@ -97,8 +97,19 @@ class ListSubscriptionsByTopicResponse extends Result implements \IteratorAggreg
$data = new \SimpleXMLElement($response->getContent());
$data = $data->ListSubscriptionsByTopicResult;
$this->subscriptions = !$data->Subscriptions ? [] : $this->populateResultSubscriptionsList($data->Subscriptions);
$this->nextToken = ($v = $data->NextToken) ? (string) $v : null;
$this->subscriptions = (0 === ($v = $data->Subscriptions)->count()) ? [] : $this->populateResultSubscriptionsList($v);
$this->nextToken = (null !== $v = $data->NextToken[0]) ? (string) $v : null;
}
private function populateResultSubscription(\SimpleXMLElement $xml): Subscription
{
return new Subscription([
'SubscriptionArn' => (null !== $v = $xml->SubscriptionArn[0]) ? (string) $v : null,
'Owner' => (null !== $v = $xml->Owner[0]) ? (string) $v : null,
'Protocol' => (null !== $v = $xml->Protocol[0]) ? (string) $v : null,
'Endpoint' => (null !== $v = $xml->Endpoint[0]) ? (string) $v : null,
'TopicArn' => (null !== $v = $xml->TopicArn[0]) ? (string) $v : null,
]);
}
/**
......@@ -108,13 +119,7 @@ class ListSubscriptionsByTopicResponse extends Result implements \IteratorAggreg
{
$items = [];
foreach ($xml->member as $item) {
$items[] = new Subscription([
'SubscriptionArn' => ($v = $item->SubscriptionArn) ? (string) $v : null,
'Owner' => ($v = $item->Owner) ? (string) $v : null,
'Protocol' => ($v = $item->Protocol) ? (string) $v : null,
'Endpoint' => ($v = $item->Endpoint) ? (string) $v : null,
'TopicArn' => ($v = $item->TopicArn) ? (string) $v : null,
]);
$items[] = $this->populateResultSubscription($item);
}
return $items;
......
......@@ -73,7 +73,7 @@ class ListTopicsResponse extends Result implements \IteratorAggregate
$page = $this;
while (true) {
$page->initialize();
if ($page->nextToken) {
if (null !== $page->nextToken) {
$input->setNextToken($page->nextToken);
$this->registerPrefetch($nextPage = $client->listTopics($input));
......@@ -97,8 +97,15 @@ class ListTopicsResponse extends Result implements \IteratorAggregate
$data = new \SimpleXMLElement($response->getContent());
$data = $data->ListTopicsResult;
$this->topics = !$data->Topics ? [] : $this->populateResultTopicsList($data->Topics);
$this->nextToken = ($v = $data->NextToken) ? (string) $v : null;
$this->topics = (0 === ($v = $data->Topics)->count()) ? [] : $this->populateResultTopicsList($v);
$this->nextToken = (null !== $v = $data->NextToken[0]) ? (string) $v : null;
}
private function populateResultTopic(\SimpleXMLElement $xml): Topic
{
return new Topic([
'TopicArn' => (null !== $v = $xml->TopicArn[0]) ? (string) $v : null,
]);
}
/**
......@@ -108,9 +115,7 @@ class ListTopicsResponse extends Result implements \IteratorAggregate
{
$items = [];
foreach ($xml->member as $item) {
$items[] = new Topic([
'TopicArn' => ($v = $item->TopicArn) ? (string) $v : null,
]);
$items[] = $this->populateResultTopic($item);
}
return $items;
......
......@@ -48,8 +48,18 @@ class PublishBatchResponse extends Result
$data = new \SimpleXMLElement($response->getContent());
$data = $data->PublishBatchResult;
$this->successful = !$data->Successful ? [] : $this->populateResultPublishBatchResultEntryList($data->Successful);
$this->failed = !$data->Failed ? [] : $this->populateResultBatchResultErrorEntryList($data->Failed);
$this->successful = (0 === ($v = $data->Successful)->count()) ? [] : $this->populateResultPublishBatchResultEntryList($v);
$this->failed = (0 === ($v = $data->Failed)->count()) ? [] : $this->populateResultBatchResultErrorEntryList($v);
}
private function populateResultBatchResultErrorEntry(\SimpleXMLElement $xml): BatchResultErrorEntry
{
return new BatchResultErrorEntry([
'Id' => (string) $xml->Id,
'Code' => (string) $xml->Code,
'Message' => (null !== $v = $xml->Message[0]) ? (string) $v : null,
'SenderFault' => filter_var((string) $xml->SenderFault, \FILTER_VALIDATE_BOOLEAN),
]);
}
/**
......@@ -59,17 +69,21 @@ class PublishBatchResponse extends Result
{
$items = [];
foreach ($xml->member as $item) {
$items[] = new BatchResultErrorEntry([
'Id' => (string) $item->Id,
'Code' => (string) $item->Code,
'Message' => ($v = $item->Message) ? (string) $v : null,
'SenderFault' => filter_var((string) $item->SenderFault, \FILTER_VALIDATE_BOOLEAN),
]);
$items[] = $this->populateResultBatchResultErrorEntry($item);
}
return $items;
}
private function populateResultPublishBatchResultEntry(\SimpleXMLElement $xml): PublishBatchResultEntry
{
return new PublishBatchResultEntry([
'Id' => (null !== $v = $xml->Id[0]) ? (string) $v : null,
'MessageId' => (null !== $v = $xml->MessageId[0]) ? (string) $v : null,
'SequenceNumber' => (null !== $v = $xml->SequenceNumber[0]) ? (string) $v : null,
]);
}
/**
* @return PublishBatchResultEntry[]
*/
......@@ -77,11 +91,7 @@ class PublishBatchResponse extends Result
{
$items = [];
foreach ($xml->member as $item) {
$items[] = new PublishBatchResultEntry([
'Id' => ($v = $item->Id) ? (string) $v : null,
'MessageId' => ($v = $item->MessageId) ? (string) $v : null,
'SequenceNumber' => ($v = $item->SequenceNumber) ? (string) $v : null,
]);
$items[] = $this->populateResultPublishBatchResultEntry($item);
}
return $items;
......
......@@ -48,7 +48,7 @@ class PublishResponse extends Result
$data = new \SimpleXMLElement($response->getContent());
$data = $data->PublishResult;
$this->messageId = ($v = $data->MessageId) ? (string) $v : null;
$this->sequenceNumber = ($v = $data->SequenceNumber) ? (string) $v : null;
$this->messageId = (null !== $v = $data->MessageId[0]) ? (string) $v : null;
$this->sequenceNumber = (null !== $v = $data->SequenceNumber[0]) ? (string) $v : null;
}
}
......@@ -31,6 +31,6 @@ class SubscribeResponse extends Result
$data = new \SimpleXMLElement($response->getContent());
$data = $data->SubscribeResult;
$this->subscriptionArn = ($v = $data->SubscriptionArn) ? (string) $v : null;
$this->subscriptionArn = (null !== $v = $data->SubscriptionArn[0]) ? (string) $v : null;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment