Skip to content

Commit

Permalink
Merge pull request #4734 from derrabus/bugfix/return-type-will-change
Browse files Browse the repository at this point in the history
Add ReturnTypeWillChange to core interface implementations
  • Loading branch information
greg0ire authored Aug 2, 2021
2 parents f2cb302 + f4a706f commit 10022d9
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Cache/ArrayStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use InvalidArgumentException;
use IteratorAggregate;
use PDO;
use ReturnTypeWillChange;

use function array_merge;
use function array_values;
Expand Down Expand Up @@ -95,6 +96,7 @@ public function setFetchMode($fetchMode, $arg2 = null, $arg3 = null)
*
* @deprecated Use iterateNumeric(), iterateAssociative() or iterateColumn() instead.
*/
#[ReturnTypeWillChange]
public function getIterator()
{
$data = $this->fetchAll();
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Cache/ResultCacheStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use InvalidArgumentException;
use IteratorAggregate;
use PDO;
use ReturnTypeWillChange;

use function array_map;
use function array_merge;
Expand Down Expand Up @@ -109,6 +110,7 @@ public function setFetchMode($fetchMode, $arg2 = null, $arg3 = null)
*
* @deprecated Use iterateNumeric(), iterateAssociative() or iterateColumn() instead.
*/
#[ReturnTypeWillChange]
public function getIterator()
{
$data = $this->fetchAll();
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use ReflectionClass;
use ReflectionObject;
use ReflectionProperty;
use ReturnTypeWillChange;
use stdClass;

use function array_change_key_case;
Expand Down Expand Up @@ -270,6 +271,7 @@ public function setFetchMode($fetchMode, $arg2 = null, $arg3 = null)
*
* @deprecated Use iterateNumeric(), iterateAssociative() or iterateColumn() instead.
*/
#[ReturnTypeWillChange]
public function getIterator()
{
return new StatementIterator($this);
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use mysqli;
use mysqli_stmt;
use PDO;
use ReturnTypeWillChange;

use function array_combine;
use function array_fill;
Expand Down Expand Up @@ -563,6 +564,7 @@ public function setFetchMode($fetchMode, $arg2 = null, $arg3 = null)
*
* @deprecated Use iterateNumeric(), iterateAssociative() or iterateColumn() instead.
*/
#[ReturnTypeWillChange]
public function getIterator()
{
return new StatementIterator($this);
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use InvalidArgumentException;
use IteratorAggregate;
use PDO;
use ReturnTypeWillChange;

use function array_key_exists;
use function assert;
Expand Down Expand Up @@ -431,6 +432,7 @@ public function setFetchMode($fetchMode, $arg2 = null, $arg3 = null)
*
* @deprecated Use iterateNumeric(), iterateAssociative() or iterateColumn() instead.
*/
#[ReturnTypeWillChange]
public function getIterator()
{
return new StatementIterator($this);
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use PDO;
use ReflectionClass;
use ReflectionObject;
use ReturnTypeWillChange;
use stdClass;

use function array_key_exists;
Expand Down Expand Up @@ -320,6 +321,7 @@ public function fetchColumn($columnIndex = 0)
*
* @deprecated Use iterateNumeric(), iterateAssociative() or iterateColumn() instead.
*/
#[ReturnTypeWillChange]
public function getIterator()
{
return new StatementIterator($this);
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Doctrine\DBAL\ParameterType;
use IteratorAggregate;
use PDO;
use ReturnTypeWillChange;

use function array_key_exists;
use function count;
Expand Down Expand Up @@ -349,6 +350,7 @@ public function setFetchMode($fetchMode, $arg2 = null, $arg3 = null)
*
* @deprecated Use iterateNumeric(), iterateAssociative() or iterateColumn() instead.
*/
#[ReturnTypeWillChange]
public function getIterator()
{
return new StatementIterator($this);
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Driver/StatementIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Doctrine\DBAL\Driver;

use IteratorAggregate;
use ReturnTypeWillChange;

/**
* @deprecated Use iterateNumeric(), iterateAssociative() or iterateColumn().
Expand All @@ -20,6 +21,7 @@ public function __construct(ResultStatement $statement)
/**
* {@inheritdoc}
*/
#[ReturnTypeWillChange]
public function getIterator()
{
while (($result = $this->statement->fetch()) !== false) {
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/ForwardCompatibility/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Doctrine\Deprecations\Deprecation;
use IteratorAggregate;
use PDO;
use ReturnTypeWillChange;
use Traversable;

use function array_shift;
Expand Down Expand Up @@ -40,6 +41,7 @@ public function __construct(Driver\ResultStatement $stmt)
/**
* @return Driver\ResultStatement
*/
#[ReturnTypeWillChange]
public function getIterator()
{
return $this->stmt;
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Portability/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Doctrine\DBAL\ParameterType;
use IteratorAggregate;
use PDO;
use ReturnTypeWillChange;

use function array_change_key_case;
use function assert;
Expand Down Expand Up @@ -134,6 +135,7 @@ public function setFetchMode($fetchMode, $arg2 = null, $arg3 = null)
*
* @deprecated Use iterateNumeric(), iterateAssociative() or iterateColumn() instead.
*/
#[ReturnTypeWillChange]
public function getIterator()
{
return new StatementIterator($this);
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Query/Expression/CompositeExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Countable;
use Doctrine\Deprecations\Deprecation;
use ReturnTypeWillChange;

use function array_merge;
use function count;
Expand Down Expand Up @@ -153,6 +154,7 @@ public function with($part, ...$parts): self
*
* @return int
*/
#[ReturnTypeWillChange]
public function count()
{
return count($this->parts);
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/DBAL/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use IteratorAggregate;
use PDO;
use PDOStatement;
use ReturnTypeWillChange;
use Throwable;
use Traversable;

Expand Down Expand Up @@ -319,6 +320,7 @@ public function setFetchMode($fetchMode, $arg2 = null, $arg3 = null)
*
* {@inheritdoc}
*/
#[ReturnTypeWillChange]
public function getIterator()
{
Deprecation::trigger(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Statement as BaseStatement;
use PDO;
use Traversable;

use function assert;

Expand Down Expand Up @@ -112,7 +113,7 @@ public function setFetchMode($fetchMode, $arg2 = null, $arg3 = null)
*
* @deprecated Use iterateNumeric(), iterateAssociative() or iterateColumn() instead.
*/
public function getIterator()
public function getIterator(): Traversable
{
return new StatementIterator($this);
}
Expand Down

0 comments on commit 10022d9

Please sign in to comment.