Skip to content

Commit c987454

Browse files
committed
php 8.1 compat
1 parent ca9c197 commit c987454

File tree

9 files changed

+23
-17
lines changed

9 files changed

+23
-17
lines changed

lib/aws-sdk/Guzzle/Common/Exception/ExceptionCollection.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function add($e)
6060
*
6161
* @return int
6262
*/
63-
public function count()
63+
public function count(): int
6464
{
6565
return count($this->exceptions);
6666
}
@@ -70,7 +70,7 @@ public function count()
7070
*
7171
* @return \ArrayIterator
7272
*/
73-
public function getIterator()
73+
public function getIterator(): \Traversable
7474
{
7575
return new \ArrayIterator($this->exceptions);
7676
}

lib/aws-sdk/Guzzle/Http/Curl/CurlMulti.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function send()
119119
}
120120
}
121121

122-
public function count()
122+
public function count(): int
123123
{
124124
return count($this->requests);
125125
}

lib/aws-sdk/Guzzle/Http/Curl/CurlMultiProxy.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function send()
105105
}
106106
}
107107

108-
public function count()
108+
public function count(): int
109109
{
110110
return count($this->all());
111111
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ public function toArray()
113113
return $this->values;
114114
}
115115

116-
public function count()
116+
public function count(): int
117117
{
118118
return count($this->toArray());
119119
}
120120

121-
public function getIterator()
121+
public function getIterator(): \Traversable
122122
{
123123
return new \ArrayIterator($this->toArray());
124124
}

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ public function get($key)
6464
return $this->offsetGet($key);
6565
}
6666

67-
public function count()
67+
public function count(): int
6868
{
6969
return count($this->headers);
7070
}
7171

72-
public function offsetExists($offset)
72+
public function offsetExists($offset): bool
7373
{
7474
return isset($this->headers[strtolower($offset)]);
7575
}
@@ -81,17 +81,17 @@ public function offsetGet($offset)
8181
return isset($this->headers[$l]) ? $this->headers[$l] : null;
8282
}
8383

84-
public function offsetSet($offset, $value)
84+
public function offsetSet($offset, $value): void
8585
{
8686
$this->add($value);
8787
}
8888

89-
public function offsetUnset($offset)
89+
public function offsetUnset($offset): void
9090
{
9191
unset($this->headers[strtolower($offset)]);
9292
}
9393

94-
public function getIterator()
94+
public function getIterator(): \Traversable
9595
{
9696
return new \ArrayIterator($this->headers);
9797
}

lib/aws-sdk/Guzzle/Http/Url.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static function factory($url)
4040
$parts += $defaults;
4141

4242
// Convert the query string into a QueryString object
43-
if ($parts['query'] || 0 !== strlen($parts['query'])) {
43+
if ($parts['query'] || 0 !== strlen($parts['query'] ?? '')) {
4444
$parts['query'] = QueryString::fromString($parts['query']);
4545
}
4646

@@ -280,6 +280,12 @@ public function setPath($path)
280280
$path = '/' . implode('/', $path);
281281
}
282282

283+
if ($path === null) {
284+
$this->path = null;
285+
286+
return $this;
287+
}
288+
283289
$this->path = strtr($path, $pathReplace);
284290

285291
return $this;

lib/aws-sdk/Guzzle/Iterator/AppendIterator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class AppendIterator extends \AppendIterator
1212
*
1313
* @param \Iterator $iterator Iterator to append
1414
*/
15-
public function append(\Iterator $iterator)
15+
public function append(\Iterator $iterator): void
1616
{
1717
$this->getArrayIterator()->append($iterator);
1818
}

lib/aws-sdk/Guzzle/Iterator/ChunkedIterator.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ public function __construct(\Traversable $iterator, $chunkSize)
2929
$this->chunkSize = $chunkSize;
3030
}
3131

32-
public function rewind()
32+
public function rewind(): void
3333
{
3434
parent::rewind();
3535
$this->next();
3636
}
3737

38-
public function next()
38+
public function next(): void
3939
{
4040
$this->chunk = array();
4141
for ($i = 0; $i < $this->chunkSize && parent::valid(); $i++) {
@@ -49,7 +49,7 @@ public function current()
4949
return $this->chunk;
5050
}
5151

52-
public function valid()
52+
public function valid(): bool
5353
{
5454
return (bool) $this->chunk;
5555
}

lib/aws-sdk/Guzzle/Iterator/FilterIterator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct(\Iterator $iterator, $callback)
2929
$this->callback = $callback;
3030
}
3131

32-
public function accept()
32+
public function accept(): bool
3333
{
3434
return call_user_func($this->callback, $this->current());
3535
}

0 commit comments

Comments
 (0)