Skip to content

Commit

Permalink
[fix] getting attribute by named php agrument keyname
Browse files Browse the repository at this point in the history
  • Loading branch information
PepperFM committed Jan 21, 2024
1 parent 324970e commit 583b11e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Support/DataType.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ protected function resolveDataCollectableClass(
$attributes = $reflection->getAttributes(DataCollectionOf::class);

if (! empty($attributes)) {
return $attributes[0]->getArguments()[0];
$attributeArgumentKey = array_key_first($attributes[0]->getArguments());

return $attributes[0]->getArguments()[$attributeArgumentKey];
}

if ($reflection instanceof ReflectionParameter) {
Expand Down

0 comments on commit 583b11e

Please sign in to comment.