get("https://www.psmnews.mv/feed")["entry"]; $articlesitems = []; //Looping through the articles and scraping and while scraping it creates a new instance of the scraper. foreach ($articles as $article) { $link = $article['id']; $date = $article['updated']; $articlesitems[] = (new PsmScraper)->extract($link, $date); } return $articlesitems; } }