diff --git a/README.md b/README.md index d9d2ace..bd1016f 100644 --- a/README.md +++ b/README.md @@ -126,11 +126,11 @@ namespace App\Integrations\MagentoStock; use JustBetter\MagentoStock\Repositories\Repository; use Illuminate\Support\Carbon; -use Illuminate\Support\Collection; +use Illuminate\Support\Enumerable; class MyStockRepository extends Repository { - public function skus(?Carbon $from = null): ?Collection + public function skus(?Carbon $from = null): ?Enumerable { return collect(['sku_1', 'sku_2']); } diff --git a/src/Repositories/BaseRepository.php b/src/Repositories/BaseRepository.php index 8e1de3b..ca6aa50 100644 --- a/src/Repositories/BaseRepository.php +++ b/src/Repositories/BaseRepository.php @@ -3,7 +3,7 @@ namespace JustBetter\MagentoStock\Repositories; use Illuminate\Support\Carbon; -use Illuminate\Support\Collection; +use Illuminate\Support\Enumerable; use JustBetter\MagentoStock\Data\StockData; abstract class BaseRepository @@ -63,8 +63,8 @@ public static function resolve(): BaseRepository return $instance; } - /** @return Collection */ - abstract public function skus(?Carbon $from = null): Collection; + /** @return Enumerable */ + abstract public function skus(?Carbon $from = null): Enumerable; abstract public function retrieve(string $sku): ?StockData; } diff --git a/src/Repositories/Repository.php b/src/Repositories/Repository.php index ee3cdd0..bf26c70 100644 --- a/src/Repositories/Repository.php +++ b/src/Repositories/Repository.php @@ -3,7 +3,7 @@ namespace JustBetter\MagentoStock\Repositories; use Illuminate\Support\Carbon; -use Illuminate\Support\Collection; +use Illuminate\Support\Enumerable; use JustBetter\MagentoProducts\Models\MagentoProduct; use JustBetter\MagentoStock\Data\StockData; use JustBetter\MagentoStock\Exceptions\NotImplementedException; @@ -15,9 +15,9 @@ public function retrieve(string $sku): ?StockData throw new NotImplementedException; } - public function skus(?Carbon $from = null): Collection + public function skus(?Carbon $from = null): Enumerable { - /** @var Collection $skus */ + /** @var Enumerable $skus */ $skus = MagentoProduct::query() ->where('exists_in_magento', '=', true) ->select(['sku'])