dingo / api

A RESTful API package for the Laravel and Lumen frameworks.
BSD 3-Clause "New" or "Revised" License
9.33k stars 1.25k forks source link

Add #[ReturnTypeWillChange] to suppress errors and deprecation notices #1788

Closed rdeprera closed 2 years ago

rdeprera commented 2 years ago

Return type of Dingo\Api\Routing\RouteCollection::count() isn't compatible with Countable::count()

On PHP 7.4 >=

dingo/api/src/Routing/RouteCollection.php on line 9

   Symfony\Component\ErrorHandler\Error\FatalError 

  During inheritance of Countable: Uncaught ErrorException: Return type of Dingo\Api\Routing\RouteCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Same on getIterator()

specialtactics commented 2 years ago

Hey

I think you need to make it more clear where this error actually comes up, also can you please make this PR here: https://github.com/api-ecosystem-for-laravel/dingo-api