eia->fetch(); if ($rows === null) { throw new BrentPriceFetchException('EIA fetch returned no data'); } BrentPrice::upsert($rows, ['date'], ['price_usd']); } /** * Fetch from FRED and persist. Throws on failure. */ public function fetchFromFred(): void { $rows = $this->fred->fetch(); if ($rows === null) { throw new BrentPriceFetchException('FRED fetch returned no data'); } BrentPrice::upsert($rows, ['date'], ['price_usd']); } }