Skip to content

Commit

Permalink
return type
Browse files Browse the repository at this point in the history
  • Loading branch information
mathsgod committed Apr 6, 2022
1 parent c3e1ad7 commit 15f9675
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/DB/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use PDOStatement;
use PHP\Util\QueryInterface;
use R\DataList;
use Traversable;

class Query implements IteratorAggregate, QueryInterface, JsonSerializable
{
Expand Down Expand Up @@ -53,7 +54,7 @@ public function setFetchMode(int $mode, string $classname, array $ctorargs): boo
return $this->statement->setFetchMode($mode, $classname, $ctorargs);
}

public function getIterator()
function getIterator(): Traversable
{
if ($this->statement === null || $this->_dirty) {
$this->execute();
Expand Down Expand Up @@ -147,7 +148,6 @@ public function sql()
$order_field = $this->orderMap[$order_field];
}
$orderby[] = $order_field . " " . $o[1];

} else {
$orderby[] = $o;
}
Expand Down Expand Up @@ -483,7 +483,7 @@ public function each(callable $callback)
array_walk($this->getIterator(), $callback);
}


public function filter(array $filter)
{
$this->_dirty = true;
Expand All @@ -493,7 +493,7 @@ public function filter(array $filter)
if (array_keys($f) === range(0, count($f) - 1)) {
//sequential array


$i = 0;
$or = [];
foreach ($f as $v) {
Expand Down
3 changes: 2 additions & 1 deletion src/ORM/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace R\ORM;

use R\RSList;
use Traversable;

class Query extends \R\DB\Query
{
Expand All @@ -15,7 +16,7 @@ public function __construct(string $class)
/**
* @return R\RSList
*/
public function getIterator()
function getIterator(): Traversable
{
$iterator = parent::getIterator();
if ($this->select) {
Expand Down

0 comments on commit 15f9675

Please sign in to comment.