Skip to content

Commit

Permalink
Better typehinting
Browse files Browse the repository at this point in the history
  • Loading branch information
mdpoulter committed Nov 14, 2023
1 parent 0778084 commit 57abf6d
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 22 deletions.
3 changes: 1 addition & 2 deletions src/ThreeZero/VendThreeZero.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions src/ThreeZeroBeta/VendThreeZeroBeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
{
Expand Down
3 changes: 1 addition & 2 deletions src/TwoZero/Requests/Promotions/GetProductsInPromotion.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions src/TwoZero/Requests/Promotions/SearchPromotions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions src/TwoZero/Requests/Quotes/ListQuotes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
{
Expand Down
3 changes: 1 addition & 2 deletions src/TwoZero/Requests/Search/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions src/TwoZero/Requests/ServiceOrders/ListServiceItems.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
{
Expand Down
3 changes: 1 addition & 2 deletions src/TwoZero/Requests/ServiceOrders/ListServices.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
{
Expand Down
3 changes: 1 addition & 2 deletions src/TwoZero/VendTwoZero.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions src/TwoZeroBeta/Requests/Audit/GetAuditLogEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions src/TwoZeroBeta/VendTwoZeroBeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down

0 comments on commit 57abf6d

Please sign in to comment.