Skip to content

Commit

Permalink
Add #[ReturnTypeWillChange] attributes to IteratorAggregate
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Aug 3, 2021
1 parent 12c44ee commit 15c0f69
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Illuminate/Collections/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,7 @@ public function pad($size, $value)
*
* @return \ArrayIterator
*/
#[ReturnTypeWillChange]
public function getIterator()
{
return new ArrayIterator($this->items);
Expand Down
2 changes: 2 additions & 0 deletions src/Illuminate/Collections/LazyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Illuminate\Support\Traits\EnumeratesValues;
use Illuminate\Support\Traits\Macroable;
use IteratorAggregate;
use ReturnTypeWillChange;
use stdClass;

class LazyCollection implements Enumerable
Expand Down Expand Up @@ -1401,6 +1402,7 @@ public function pad($size, $value)
*
* @return \Traversable
*/
#[ReturnTypeWillChange]
public function getIterator()
{
return $this->makeIterator($this->source);
Expand Down
2 changes: 2 additions & 0 deletions src/Illuminate/Container/RewindableGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Countable;
use IteratorAggregate;
use ReturnTypeWillChange;

class RewindableGenerator implements Countable, IteratorAggregate
{
Expand Down Expand Up @@ -39,6 +40,7 @@ public function __construct(callable $generator, $count)
*
* @return mixed
*/
#[ReturnTypeWillChange]
public function getIterator()
{
return ($this->generator)();
Expand Down
2 changes: 2 additions & 0 deletions src/Illuminate/Http/Resources/CollectsResources.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Pagination\AbstractPaginator;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use ReturnTypeWillChange;

trait CollectsResources
{
Expand Down Expand Up @@ -59,6 +60,7 @@ class_exists($class = Str::replaceLast('Collection', 'Resource', get_class($this
*
* @return \ArrayIterator
*/
#[ReturnTypeWillChange]
public function getIterator()
{
return $this->collection->getIterator();
Expand Down
1 change: 1 addition & 0 deletions src/Illuminate/Pagination/AbstractCursorPaginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ public static function viewFactory()
*
* @return \ArrayIterator
*/
#[ReturnTypeWillChange]
public function getIterator()
{
return $this->items->getIterator();
Expand Down
1 change: 1 addition & 0 deletions src/Illuminate/Pagination/AbstractPaginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ public static function useBootstrapThree()
*
* @return \ArrayIterator
*/
#[ReturnTypeWillChange]
public function getIterator()
{
return $this->items->getIterator();
Expand Down
2 changes: 2 additions & 0 deletions src/Illuminate/Routing/AbstractRouteCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Illuminate\Support\Str;
use IteratorAggregate;
use LogicException;
use ReturnTypeWillChange;
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\Matcher\Dumper\CompiledUrlMatcherDumper;
Expand Down Expand Up @@ -237,6 +238,7 @@ protected function generateRouteName()
*
* @return \ArrayIterator
*/
#[ReturnTypeWillChange]
public function getIterator()
{
return new ArrayIterator($this->getRoutes());
Expand Down
1 change: 1 addition & 0 deletions src/Illuminate/View/ComponentAttributeBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ public function offsetUnset($offset)
*
* @return \ArrayIterator
*/
#[ReturnTypeWillChange]
public function getIterator()
{
return new ArrayIterator($this->attributes);
Expand Down
2 changes: 2 additions & 0 deletions src/Illuminate/View/InvokableComponentVariable.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Contracts\Support\DeferringDisplayableValue;
use Illuminate\Support\Enumerable;
use IteratorAggregate;
use ReturnTypeWillChange;

class InvokableComponentVariable implements DeferringDisplayableValue, IteratorAggregate
{
Expand Down Expand Up @@ -43,6 +44,7 @@ public function resolveDisplayableValue()
*
* @return \ArrayIterator
*/
#[ReturnTypeWillChange]
public function getIterator()
{
$result = $this->__invoke();
Expand Down

0 comments on commit 15c0f69

Please sign in to comment.