Skip to content

Commit

Permalink
fix(metadata): defaults (#4759)
Browse files Browse the repository at this point in the history
  • Loading branch information
soyuka authored May 16, 2022
1 parent 1997785 commit 8156b9f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ final class AttributesResourceMetadataCollectionFactory implements ResourceMetad

public function __construct(ResourceMetadataCollectionFactoryInterface $decorated = null, LoggerInterface $logger = null, array $defaults = [], bool $graphQlEnabled = false)
{
$this->defaults = $defaults + ['attributes' => []];
$this->defaults = $defaults;
$this->decorated = $decorated;
$this->logger = $logger ?? new NullLogger();
$this->graphQlEnabled = $graphQlEnabled;
Expand Down Expand Up @@ -235,7 +235,7 @@ private function getOperationWithDefaults(ApiResource $resource, Operation $oper
private function addGlobalDefaults($operation)
{
$extraProperties = $operation->getExtraProperties();
foreach ($this->defaults['attributes'] as $key => $value) {
foreach ($this->defaults as $key => $value) {
[$newKey, $value] = $this->getKeyValue($key, $value);
$upperKey = ucfirst($newKey);
$getter = 'get'.$upperKey;
Expand Down

0 comments on commit 8156b9f

Please sign in to comment.