Dymantic / laravel-instagram-feed

150 stars 51 forks source link

Update Typage LOG.warning: Return type #66

Open xDesignX opened 1 year ago

xDesignX commented 1 year ago
    public function getIterator()
    {
        return new ArrayIterator($this->items);
    }

 LOG.warning: Return type of Dymantic\InstagramFeed\InstagramFeed::getIterator()

    public function count()
    {
        return count($this->items);
    }

LOG.warning: Return type of Dymantic\InstagramFeed\InstagramFeed::count() should either be compatible with Countable::count(): int,

TO

   public function getIterator() : ArrayIterator
    {
        return new ArrayIterator($this->items);
    }

    public function count() : Int
    {
        return count($this->items);
    }

Can you update the function ?

Thank You for your instagram module

vigorjs commented 1 year ago

i also facing the same problem :( error log : DEPRECATED Return type of Dymantic\InstagramFeed\InstagramFeed::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor\dymantic\laravel-instagram-feed\src\InstagramFeed.php on line 42.

DEPRECATED Return type of Dymantic\InstagramFeed\InstagramFeed::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor\dymantic\laravel-instagram-feed\src\InstagramFeed.php on line 47.