Skip to content

Commit

Permalink
Update StatementInterface.
Browse files Browse the repository at this point in the history
Fix errors reported by static analysis
  • Loading branch information
ADmad committed Apr 7, 2024
1 parent a5f17eb commit de5c56b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/Database/Statement/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
use Cake\Database\TypeInterface;
use Generator;
use InvalidArgumentException;
use IteratorAggregate;
use PDO;
use PDOStatement;

class Statement implements StatementInterface, IteratorAggregate
class Statement implements StatementInterface
{
/**
* @var array<string, int>
Expand Down
6 changes: 5 additions & 1 deletion src/Database/StatementInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
*/
namespace Cake\Database;

use IteratorAggregate;
use PDO;

interface StatementInterface
/**
* @template-extends \IteratorAggregate<array>
*/
interface StatementInterface extends IteratorAggregate
{
/**
* Maps to PDO::FETCH_NUM.
Expand Down
4 changes: 2 additions & 2 deletions src/ORM/EagerLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -609,10 +609,10 @@ protected function _resolveJoins(array $associations, array $matching = []): arr
* @param \Cake\ORM\Query\SelectQuery $query The query for which to eager load external.
* associations.
* @param iterable $results Results.
* @return array
* @return iterable
* @throws \RuntimeException
*/
public function loadExternal(SelectQuery $query, iterable $results): array
public function loadExternal(SelectQuery $query, iterable $results): iterable
{
if (!$results) {
return $results;
Expand Down
2 changes: 1 addition & 1 deletion src/ORM/ResultSetFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ResultSetFactory
* Constructor
*
* @param \Cake\ORM\Query\SelectQuery<T> $query Query from where results came.
* @param array $results Results array.
* @param iterable $results Results.
* @return \Cake\ORM\ResultSet<array|\Cake\Datasource\EntityInterface>
*/
public function createResultSet(SelectQuery $query, iterable $results): ResultSet
Expand Down

0 comments on commit de5c56b

Please sign in to comment.