with cast tests
This commit is contained in:
parent
afb47c1977
commit
3a26a2e0c2
8 changed files with 154 additions and 3 deletions
|
|
@ -78,9 +78,9 @@ trait DataObject
|
|||
foreach ($parameters as $parameter) {
|
||||
$parameterName = $parameter->reflection->getName();
|
||||
|
||||
if ($mapper = array_first($parameter->reflection->getAttributes(CastWith::class))) {
|
||||
if ($castWith = array_first($parameter->reflection->getAttributes(CastWith::class))) {
|
||||
$value = App::call(
|
||||
[App::make($mapper->newInstance()->class), 'map'],
|
||||
[App::make($castWith->newInstance()->class), 'cast'],
|
||||
['value' => $validator->getValue($parameterName)],
|
||||
);
|
||||
$mappedInput[$parameterName] = $value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue