Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make transformer parameter nullable #1734

Merged
merged 1 commit into from
Oct 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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