Skip to content

Commit 0d9c9f8

Browse files
authored
Issue-203: PHP 8.1 deprecations
Closes #203
1 parent 95fb25c commit 0d9c9f8

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

src/Pagination/ResourceCursor.php

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,12 @@
1111
*/
1212
class ResourceCursor implements ResourceCursorInterface
1313
{
14-
/** @var PageInterface */
15-
protected $currentPage;
16-
17-
/** @var PageInterface */
18-
protected $firstPage;
19-
14+
protected PageInterface $currentPage;
15+
protected PageInterface $firstPage;
2016
/** @var null|int */
2117
protected $pageSize;
22-
23-
/** @var int */
24-
protected $currentIndex = 0;
25-
26-
/** @var int */
27-
protected $totalIndex = 0;
18+
protected int $currentIndex = 0;
19+
protected int $totalIndex = 0;
2820

2921
public function __construct(?int $pageSize, PageInterface $firstPage)
3022
{
@@ -35,6 +27,7 @@ public function __construct(?int $pageSize, PageInterface $firstPage)
3527

3628
/**
3729
* {@inheritdoc}
30+
* @return mixed
3831
*/
3932
public function current()
4033
{
@@ -44,7 +37,7 @@ public function current()
4437
/**
4538
* {@inheritdoc}
4639
*/
47-
public function next()
40+
public function next(): void
4841
{
4942
$this->currentIndex++;
5043
$this->totalIndex++;
@@ -68,15 +61,15 @@ public function key()
6861
/**
6962
* {@inheritdoc}
7063
*/
71-
public function valid()
64+
public function valid(): bool
7265
{
7366
return isset($this->currentPage->getItems()[$this->currentIndex]);
7467
}
7568

7669
/**
7770
* {@inheritdoc}
7871
*/
79-
public function rewind()
72+
public function rewind(): void
8073
{
8174
$this->totalIndex = 0;
8275
$this->currentIndex = 0;

src/Routing/UriGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function generate($path, array $uriParameters = [], array $queryParameter
4040
}
4141

4242
if (!empty($queryParameters)) {
43-
$uri .= '?' . http_build_query($queryParameters, null, '&', PHP_QUERY_RFC3986);
43+
$uri .= '?' . http_build_query($queryParameters, "", '&', PHP_QUERY_RFC3986);
4444
}
4545

4646
return $uri;

0 commit comments

Comments
 (0)