Skip to content

Commit

Permalink
Fixes PHP-notice
Browse files Browse the repository at this point in the history
Without having int as return type, we will generate notices like

```
Return type of Spatie\LaravelData\DataCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/ahoi/test/vendor/spatie/laravel-data/src/DataCollection.php on line 104
```
  • Loading branch information
ahoiroman authored Dec 1, 2021
1 parent 5b1db07 commit 90114eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DataCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function getIterator(): ArrayIterator
return new ArrayIterator($this->transform(TransformationType::withoutValueTransforming()));
}

public function count()
public function count(): int
{
return count($this->items);
}
Expand Down

0 comments on commit 90114eb

Please sign in to comment.