Skip to content

Commit

Permalink
Make transformer parameter nullable
Browse files Browse the repository at this point in the history
Make transformer parameter nullable for paginator/collection
  • Loading branch information
xwiz authored Jun 19, 2020
1 parent 8c0fff4 commit 7f5d8bc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Http/Response/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,14 @@ public function collection(Collection $collection, $transformer = null, $paramet
/**
* Bind an item to a transformer and start building a response.
*
* @param object $item
* @param string|callable|object $transformer
* @param array $parameters
* @param \Closure $after
* @param object $item
* @param null|string|callable|object $transformer
* @param array $parameters
* @param \Closure $after
*
* @return \Dingo\Api\Http\Response
*/
public function item($item, $transformer, $parameters = [], Closure $after = null)
public function item($item, $transformer = null, $parameters = [], Closure $after = null)
{
$class = get_class($item);

Expand All @@ -147,13 +147,13 @@ public function item($item, $transformer, $parameters = [], Closure $after = nul
* Bind a paginator to a transformer and start building a response.
*
* @param \Illuminate\Contracts\Pagination\Paginator $paginator
* @param string|callable|object $transformer
* @param null|string|callable|object $transformer
* @param array $parameters
* @param \Closure $after
*
* @return \Dingo\Api\Http\Response
*/
public function paginator(Paginator $paginator, $transformer, array $parameters = [], Closure $after = null)
public function paginator(Paginator $paginator, $transformer = null, array $parameters = [], Closure $after = null)
{
if ($paginator->isEmpty()) {
$class = get_class($paginator);
Expand Down

0 comments on commit 7f5d8bc

Please sign in to comment.