Skip to content

Commit

Permalink
Fix iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
mpysiak committed Feb 5, 2025
1 parent 4db6bc2 commit c7aea30
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Sylius package.
*
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Sylius\Bundle\ApiBundle\Resolver;
Expand Down Expand Up @@ -35,7 +44,10 @@ public function resolve(string $resourceClass, ?string $pathPrefix, ?Operation $
return $operation;
}

$namePrefixes = array_merge($this->defaultNamePrefixes, $this->additionalNamePrefixes);
$namePrefixes = array_unique(array_merge(
$this->defaultNamePrefixes,
is_array($this->additionalNamePrefixes) ? $this->additionalNamePrefixes : iterator_to_array($this->additionalNamePrefixes),
));

$resourceMetadataCollection = $this->resourceMetadataCollectionFactory->create($resourceClass);
foreach ($resourceMetadataCollection as $resourceMetadata) {
Expand Down

0 comments on commit c7aea30

Please sign in to comment.