Skip to content

Commit

Permalink
feat: get empty valid transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad-Alavi committed Jun 3, 2024
1 parent f8b8347 commit 16e4b1f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Abstracts/Transformers/Transformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,11 @@ protected function collection($data, $transformer, string|null $resourceKey = nu

return parent::collection($data, $transformer, $resourceKey);
}

public static function empty(): callable
{
return static function () {
return [];
};
}
}

0 comments on commit 16e4b1f

Please sign in to comment.