From 57abf6df475613cc9f4e6b7331653396d9ff9545 Mon Sep 17 00:00:00 2001 From: Matthew Poulter Date: Tue, 14 Nov 2023 12:23:38 +0100 Subject: [PATCH] Better typehinting --- src/ThreeZero/VendThreeZero.php | 3 +-- src/ThreeZeroBeta/VendThreeZeroBeta.php | 3 +-- src/TwoZero/Requests/Promotions/GetProductsInPromotion.php | 3 +-- src/TwoZero/Requests/Promotions/SearchPromotions.php | 3 +-- src/TwoZero/Requests/Quotes/ListQuotes.php | 3 +-- src/TwoZero/Requests/Search/Search.php | 3 +-- src/TwoZero/Requests/ServiceOrders/ListServiceItems.php | 3 +-- src/TwoZero/Requests/ServiceOrders/ListServices.php | 3 +-- src/TwoZero/VendTwoZero.php | 3 +-- src/TwoZeroBeta/Requests/Audit/GetAuditLogEvents.php | 3 +-- src/TwoZeroBeta/VendTwoZeroBeta.php | 3 +-- 11 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/ThreeZero/VendThreeZero.php b/src/ThreeZero/VendThreeZero.php index 6d4d565..1d77dcf 100644 --- a/src/ThreeZero/VendThreeZero.php +++ b/src/ThreeZero/VendThreeZero.php @@ -4,7 +4,6 @@ use Saloon\Http\Request; use Saloon\PaginationPlugin\Contracts\HasPagination; -use Saloon\PaginationPlugin\Paginator; use SimpleSquid\Vend\Common\Paginators\VendCursorPaginator; use SimpleSquid\Vend\ThreeZero\Resources\PriceBooks; use SimpleSquid\Vend\VendConnector; @@ -21,7 +20,7 @@ public function resolveBaseUrl(): string return parent::resolveBaseUrl().'/3.0'; } - public function paginate(Request $request): Paginator + public function paginate(Request $request): VendCursorPaginator { return new VendCursorPaginator($this, $request); } diff --git a/src/ThreeZeroBeta/VendThreeZeroBeta.php b/src/ThreeZeroBeta/VendThreeZeroBeta.php index 7e429d9..01840eb 100644 --- a/src/ThreeZeroBeta/VendThreeZeroBeta.php +++ b/src/ThreeZeroBeta/VendThreeZeroBeta.php @@ -4,7 +4,6 @@ use Saloon\Http\Request; use Saloon\PaginationPlugin\Contracts\HasPagination; -use Saloon\PaginationPlugin\Paginator; use SimpleSquid\Vend\Common\Paginators\VendCursorPaginator; use SimpleSquid\Vend\ThreeZeroBeta\Resources\Products; use SimpleSquid\Vend\VendConnector; @@ -23,7 +22,7 @@ public function resolveBaseUrl(): string return parent::resolveBaseUrl().'/3.0'; } - public function paginate(Request $request): Paginator + public function paginate(Request $request): VendCursorPaginator { return new class($this, $request) extends VendCursorPaginator { diff --git a/src/TwoZero/Requests/Promotions/GetProductsInPromotion.php b/src/TwoZero/Requests/Promotions/GetProductsInPromotion.php index 5e87d40..50d4372 100644 --- a/src/TwoZero/Requests/Promotions/GetProductsInPromotion.php +++ b/src/TwoZero/Requests/Promotions/GetProductsInPromotion.php @@ -6,7 +6,6 @@ use Saloon\Http\Connector; use Saloon\Http\Request; use Saloon\PaginationPlugin\Contracts\HasRequestPagination; -use Saloon\PaginationPlugin\Paginator; use SimpleSquid\Vend\Common\Paginators\VendOffsetPaginator; class GetProductsInPromotion extends Request implements HasRequestPagination @@ -35,7 +34,7 @@ public function defaultQuery(): array ]); } - public function paginate(Connector $connector): Paginator + public function paginate(Connector $connector): VendOffsetPaginator { return new VendOffsetPaginator($connector, $this); } diff --git a/src/TwoZero/Requests/Promotions/SearchPromotions.php b/src/TwoZero/Requests/Promotions/SearchPromotions.php index a3048b0..09838f6 100644 --- a/src/TwoZero/Requests/Promotions/SearchPromotions.php +++ b/src/TwoZero/Requests/Promotions/SearchPromotions.php @@ -6,7 +6,6 @@ use Saloon\Http\Connector; use Saloon\Http\Request; use Saloon\PaginationPlugin\Contracts\HasRequestPagination; -use Saloon\PaginationPlugin\Paginator; use SimpleSquid\Vend\Common\Paginators\VendOffsetPaginator; class SearchPromotions extends Request implements HasRequestPagination @@ -49,7 +48,7 @@ public function defaultQuery(): array ]); } - public function paginate(Connector $connector): Paginator + public function paginate(Connector $connector): VendOffsetPaginator { return new VendOffsetPaginator($connector, $this); } diff --git a/src/TwoZero/Requests/Quotes/ListQuotes.php b/src/TwoZero/Requests/Quotes/ListQuotes.php index 2033115..03d6273 100644 --- a/src/TwoZero/Requests/Quotes/ListQuotes.php +++ b/src/TwoZero/Requests/Quotes/ListQuotes.php @@ -6,7 +6,6 @@ use Saloon\Http\Connector; use Saloon\Http\Request; use Saloon\PaginationPlugin\Contracts\HasRequestPagination; -use Saloon\PaginationPlugin\Paginator; use SimpleSquid\Vend\Common\Paginators\VendCursorPaginator; class ListQuotes extends Request implements HasRequestPagination @@ -32,7 +31,7 @@ public function defaultQuery(): array ]); } - public function paginate(Connector $connector): Paginator + public function paginate(Connector $connector): VendCursorPaginator { return new class($connector, $this) extends VendCursorPaginator { diff --git a/src/TwoZero/Requests/Search/Search.php b/src/TwoZero/Requests/Search/Search.php index d2e159d..0dc9521 100644 --- a/src/TwoZero/Requests/Search/Search.php +++ b/src/TwoZero/Requests/Search/Search.php @@ -6,7 +6,6 @@ use Saloon\Http\Connector; use Saloon\Http\Request; use Saloon\PaginationPlugin\Contracts\HasRequestPagination; -use Saloon\PaginationPlugin\Paginator; use SimpleSquid\Vend\Common\Paginators\VendOffsetPaginator; class Search extends Request implements HasRequestPagination @@ -45,7 +44,7 @@ public function defaultQuery(): array ] + $this->searchAttributes); } - public function paginate(Connector $connector): Paginator + public function paginate(Connector $connector): VendOffsetPaginator { return new VendOffsetPaginator($connector, $this); } diff --git a/src/TwoZero/Requests/ServiceOrders/ListServiceItems.php b/src/TwoZero/Requests/ServiceOrders/ListServiceItems.php index 56b2a0a..c1bbcea 100644 --- a/src/TwoZero/Requests/ServiceOrders/ListServiceItems.php +++ b/src/TwoZero/Requests/ServiceOrders/ListServiceItems.php @@ -6,7 +6,6 @@ use Saloon\Http\Connector; use Saloon\Http\Request; use Saloon\PaginationPlugin\Contracts\HasRequestPagination; -use Saloon\PaginationPlugin\Paginator; use SimpleSquid\Vend\Common\Paginators\VendCursorPaginator; class ListServiceItems extends Request implements HasRequestPagination @@ -32,7 +31,7 @@ public function defaultQuery(): array ]); } - public function paginate(Connector $connector): Paginator + public function paginate(Connector $connector): VendCursorPaginator { return new class($connector, $this) extends VendCursorPaginator { diff --git a/src/TwoZero/Requests/ServiceOrders/ListServices.php b/src/TwoZero/Requests/ServiceOrders/ListServices.php index 89f6507..869e79b 100644 --- a/src/TwoZero/Requests/ServiceOrders/ListServices.php +++ b/src/TwoZero/Requests/ServiceOrders/ListServices.php @@ -6,7 +6,6 @@ use Saloon\Http\Connector; use Saloon\Http\Request; use Saloon\PaginationPlugin\Contracts\HasRequestPagination; -use Saloon\PaginationPlugin\Paginator; use SimpleSquid\Vend\Common\Paginators\VendCursorPaginator; class ListServices extends Request implements HasRequestPagination @@ -32,7 +31,7 @@ public function defaultQuery(): array ]); } - public function paginate(Connector $connector): Paginator + public function paginate(Connector $connector): VendCursorPaginator { return new class($connector, $this) extends VendCursorPaginator { diff --git a/src/TwoZero/VendTwoZero.php b/src/TwoZero/VendTwoZero.php index 82124a5..3e70d2b 100644 --- a/src/TwoZero/VendTwoZero.php +++ b/src/TwoZero/VendTwoZero.php @@ -4,7 +4,6 @@ use Saloon\Http\Request; use Saloon\PaginationPlugin\Contracts\HasPagination; -use Saloon\PaginationPlugin\Paginator; use SimpleSquid\Vend\Common\Paginators\VendCursorPaginator; use SimpleSquid\Vend\TwoZero\Resources\Audit; use SimpleSquid\Vend\TwoZero\Resources\Brands; @@ -50,7 +49,7 @@ public function resolveBaseUrl(): string return parent::resolveBaseUrl().'/2.0'; } - public function paginate(Request $request): Paginator + public function paginate(Request $request): VendCursorPaginator { return new VendCursorPaginator($this, $request); } diff --git a/src/TwoZeroBeta/Requests/Audit/GetAuditLogEvents.php b/src/TwoZeroBeta/Requests/Audit/GetAuditLogEvents.php index e91c97c..cd4ecad 100644 --- a/src/TwoZeroBeta/Requests/Audit/GetAuditLogEvents.php +++ b/src/TwoZeroBeta/Requests/Audit/GetAuditLogEvents.php @@ -6,7 +6,6 @@ use Saloon\Http\Connector; use Saloon\Http\Request; use Saloon\PaginationPlugin\Contracts\HasRequestPagination; -use Saloon\PaginationPlugin\Paginator; use SimpleSquid\Vend\Common\Paginators\VendOffsetPaginator; class GetAuditLogEvents extends Request implements HasRequestPagination @@ -42,7 +41,7 @@ public function defaultQuery(): array ]); } - public function paginate(Connector $connector): Paginator + public function paginate(Connector $connector): VendOffsetPaginator { return new VendOffsetPaginator($connector, $this); } diff --git a/src/TwoZeroBeta/VendTwoZeroBeta.php b/src/TwoZeroBeta/VendTwoZeroBeta.php index 263fa68..ba93114 100644 --- a/src/TwoZeroBeta/VendTwoZeroBeta.php +++ b/src/TwoZeroBeta/VendTwoZeroBeta.php @@ -4,7 +4,6 @@ use Saloon\Http\Request; use Saloon\PaginationPlugin\Contracts\HasPagination; -use Saloon\PaginationPlugin\Paginator; use SimpleSquid\Vend\Common\Paginators\VendCursorPaginator; use SimpleSquid\Vend\TwoZeroBeta\Resources\Audit; use SimpleSquid\Vend\TwoZeroBeta\Resources\GiftCards; @@ -22,7 +21,7 @@ public function resolveBaseUrl(): string return parent::resolveBaseUrl().'/2.0'; } - public function paginate(Request $request): Paginator + public function paginate(Request $request): VendCursorPaginator { return new VendCursorPaginator($this, $request); }