Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Naoray committed Oct 30, 2023
1 parent e934ce8 commit cde2bbc
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/Resources/LazyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ public function filter(callable $callback): self
* @param (callable(value): bool)|null $callback
* @return mixed|null
*/
public function first(callable $callback = null): mixed
public function first(callable $callback = null)

Check failure on line 73 in src/Resources/LazyCollection.php

View workflow job for this annotation

GitHub Actions / PHP - 8

Parameter $callback of method Mollie\Api\Resources\LazyCollection::first() has invalid type Mollie\Api\Resources\value.

Check failure on line 73 in src/Resources/LazyCollection.php

View workflow job for this annotation

GitHub Actions / PHP - 7.3

Parameter $callback of method Mollie\Api\Resources\LazyCollection::first() has invalid type Mollie\Api\Resources\value.

Check failure on line 73 in src/Resources/LazyCollection.php

View workflow job for this annotation

GitHub Actions / PHP - 7.4

Parameter $callback of method Mollie\Api\Resources\LazyCollection::first() has invalid type Mollie\Api\Resources\value.

Check failure on line 73 in src/Resources/LazyCollection.php

View workflow job for this annotation

GitHub Actions / PHP - 7.4

Parameter $callback of method Mollie\Api\Resources\LazyCollection::first() has invalid type Mollie\Api\Resources\value.

Check failure on line 73 in src/Resources/LazyCollection.php

View workflow job for this annotation

GitHub Actions / PHP - 7.3

Parameter $callback of method Mollie\Api\Resources\LazyCollection::first() has invalid type Mollie\Api\Resources\value.

Check failure on line 73 in src/Resources/LazyCollection.php

View workflow job for this annotation

GitHub Actions / PHP - 8

Parameter $callback of method Mollie\Api\Resources\LazyCollection::first() has invalid type Mollie\Api\Resources\value.

Check failure on line 73 in src/Resources/LazyCollection.php

View workflow job for this annotation

GitHub Actions / PHP - 8.1

Parameter $callback of method Mollie\Api\Resources\LazyCollection::first() has invalid type Mollie\Api\Resources\value.

Check failure on line 73 in src/Resources/LazyCollection.php

View workflow job for this annotation

GitHub Actions / PHP - 8.2

Parameter $callback of method Mollie\Api\Resources\LazyCollection::first() has invalid type Mollie\Api\Resources\value.

Check failure on line 73 in src/Resources/LazyCollection.php

View workflow job for this annotation

GitHub Actions / PHP - 8.2

Parameter $callback of method Mollie\Api\Resources\LazyCollection::first() has invalid type Mollie\Api\Resources\value.
{
$iterator = $this->getIterator();

if (is_null($callback)) {
if (! $iterator->valid()) {
if (!$iterator->valid()) {
return null;
}

Expand Down Expand Up @@ -118,7 +118,7 @@ public function take(int $limit): self
$iterator = $this->getIterator();

while ($limit--) {
if (! $iterator->valid()) {
if (!$iterator->valid()) {
break;
}

Expand All @@ -142,7 +142,7 @@ public function every(callable $callback): bool
$iterator = $this->getIterator();

foreach ($iterator as $key => $value) {
if (! $callback($value, $key)) {
if (!$callback($value, $key)) {
return false;
}
}
Expand Down Expand Up @@ -184,9 +184,4 @@ protected function makeIterator($source): Iterator

return $source();
}

public function __call($name, $arguments)
{
var_dump($this->getIterator());
}
}

0 comments on commit cde2bbc

Please sign in to comment.