mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
added comments to custom data pipe class
This commit is contained in:
parent
413df48fdc
commit
e4ece66acc
@ -6,7 +6,12 @@ use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Collection;
|
||||
use Spatie\LaravelData\Support\DataClass;
|
||||
|
||||
class MapRouteParametersDataPipe implements \Spatie\LaravelData\DataPipes\DataPipe
|
||||
/**
|
||||
* Maps route parameters to the data class properties if a request object payload is present.
|
||||
*
|
||||
* This makes the mapping of requests to dtos easier: The controller action only has to have the dto as argument.
|
||||
*/
|
||||
final class MapRouteParametersDataPipe implements \Spatie\LaravelData\DataPipes\DataPipe
|
||||
{
|
||||
public function handle(mixed $payload, DataClass $class, Collection $properties): Collection
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user