Skip to content

Commit 2b6c8b5

Browse files
committed
php 8.1 compat
1 parent c987454 commit 2b6c8b5

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

lib/aws-sdk/Guzzle/Http/Message/Header/HeaderCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function offsetExists($offset): bool
7474
return isset($this->headers[strtolower($offset)]);
7575
}
7676

77-
public function offsetGet($offset)
77+
public function offsetGet($offset): mixed
7878
{
7979
$l = strtolower($offset);
8080

lib/aws-sdk/Guzzle/Http/Message/Response.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,20 @@ public function unserialize($serialize)
175175
$this->__construct($data['status'], $data['headers'], $data['body']);
176176
}
177177

178+
public function __serialize(): array
179+
{
180+
return array(
181+
'status' => $this->statusCode,
182+
'body' => (string) $this->body,
183+
'headers' => $this->headers->toArray()
184+
);
185+
}
186+
187+
public function __unserialize(array $data): void
188+
{
189+
$this->__construct($data['status'], $data['headers'], $data['body']);
190+
}
191+
178192
/**
179193
* Get the response entity body
180194
*

lib/aws-sdk/Guzzle/Service/Resource/ResourceIterator.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,17 @@ public function set($key, $value)
121121
return $this;
122122
}
123123

124-
public function current()
124+
public function current(): mixed
125125
{
126126
return $this->resources ? current($this->resources) : false;
127127
}
128128

129-
public function key()
129+
public function key(): mixed
130130
{
131131
return max(0, $this->iteratedCount - 1);
132132
}
133133

134-
public function count()
134+
public function count(): int
135135
{
136136
return $this->retrievedCount;
137137
}
@@ -149,21 +149,21 @@ public function getRequestCount()
149149
/**
150150
* Rewind the Iterator to the first element and send the original command
151151
*/
152-
public function rewind()
152+
public function rewind(): void
153153
{
154154
// Use the original command
155155
$this->command = clone $this->originalCommand;
156156
$this->resetState();
157157
$this->next();
158158
}
159159

160-
public function valid()
160+
public function valid(): bool
161161
{
162162
return !$this->invalid && (!$this->resources || $this->current() || $this->nextToken)
163163
&& (!$this->limit || $this->iteratedCount < $this->limit + 1);
164164
}
165165

166-
public function next()
166+
public function next(): void
167167
{
168168
$this->iteratedCount++;
169169

0 commit comments

Comments
 (0)