Skip to content

Commit

Permalink
Merge pull request #1734 from xwiz/enable_bindings
Browse files Browse the repository at this point in the history
Make transformer parameter nullable
  • Loading branch information
specialtactics authored Oct 5, 2020
2 parents 660fd77 + 7f5d8bc commit 85866b7
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)
{
// Check for $item being null
if (! is_null($item)) {
Expand All @@ -152,13 +152,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 85866b7

Please sign in to comment.