Skip to content

Commit

Permalink
Merge pull request #27 from outlandishideas/2023-11-30-make-return-ty…
Browse files Browse the repository at this point in the history
…pes-compatible-with-parent

Make return types of functions compatible with parents
  • Loading branch information
rasmuswinter authored Nov 30, 2023
2 parents a6cee26 + 84dc4b3 commit 889fa3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
}
],
"require": {
"php": ">=7.1",
"composer/installers": "^1.0 || ^2.0"
}
}
12 changes: 6 additions & 6 deletions src/OowpQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,32 +40,32 @@ function __construct($query = '')

/* Interfaces */

public function getIterator()
public function getIterator(): \Traversable
{
return new \ArrayIterator($this->posts);
}

public function offsetExists($offset)
public function offsetExists($offset): bool
{
return isset($this->posts[$offset]);
}

public function offsetGet($offset)
public function offsetGet($offset): mixed
{
return $this->posts[$offset];
}

public function offsetSet($offset, $value)
public function offsetSet($offset, $value): void
{
$this->posts[$offset] = $value;
}

public function offsetUnset($offset)
public function offsetUnset($offset): void
{
unset($this->posts[$offset]);
}

public function count()
public function count(): int
{
return count($this->posts);
}
Expand Down

0 comments on commit 889fa3f

Please sign in to comment.