Skip to content

Commit

Permalink
fix: types (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
wilr committed May 10, 2023
1 parent 18503a2 commit 5f34d51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"issues": "http://github.com/heyday/silverstripe-elastica/issues"
},
"require": {
"php": ">=8.1",
"ruflin/elastica": "^7",
"elasticsearch/elasticsearch": ">=7.3.0",
"symbiote/silverstripe-queuedjobs": "*"
Expand All @@ -30,7 +31,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "4.1.x-dev"
"dev-main": "4.2.x-dev"
}
},
"minimum-stability": "dev",
Expand Down
10 changes: 5 additions & 5 deletions src/ResultList.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ public function getResults()
}

/**
* @return ArrayIterator|Traversable
* @return Traversable
*/
public function getIterator()
public function getIterator(): Traversable
{
return new ArrayIterator($this->toArray());
}
Expand All @@ -155,7 +155,7 @@ public function getIterator()
* @param int $offset
* @return ResultList
*/
public function limit($limit, $offset = 0)
public function limit(?int $limit, int $offset = 0): Limitable
{
$list = clone $this;

Expand Down Expand Up @@ -395,7 +395,7 @@ public function getTotalItems()
/**
* @inheritdoc
*/
public function offsetExists($offset): bool
public function offsetExists(mixed $offset): bool
{
$array = $this->toArray();
return array_key_exists($offset, $array);
Expand All @@ -404,7 +404,7 @@ public function offsetExists($offset): bool
/**
* @inheritdoc
*/
public function offsetGet($offset)
public function offsetGet(mixed $offset): mixed
{
$array = $this->toArray();
return isset($array[$offset]) ? $array[$offset] : null;
Expand Down

0 comments on commit 5f34d51

Please sign in to comment.