Skip to content

Commit

Permalink
Fix exception message
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvanassche committed Jul 5, 2023
1 parent 11a3f79 commit 877051d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Exceptions/CannotCreateData.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Exception;
use Illuminate\Support\Collection;
use Spatie\LaravelData\Support\DataClass;
use Spatie\LaravelData\Support\DataParameter;
use Spatie\LaravelData\Support\DataProperty;
use Throwable;

Expand Down Expand Up @@ -36,8 +37,8 @@ public static function constructorMissingParameters(
$message .= " Parameters missing: {$dataClass
->constructorMethod
->parameters
->reject(fn (DataProperty $parameter) => $parameters->has($parameter->name))
->map(fn (DataProperty $parameter) => $parameter->name)
->reject(fn (DataProperty|DataParameter $parameter) => $parameters->has($parameter->name))
->map(fn (DataProperty|DataParameter $parameter) => $parameter->name)
->join(', ')}.";

return new self($message, previous: $previous);
Expand Down

0 comments on commit 877051d

Please sign in to comment.