Skip to content
This repository has been archived by the owner on Nov 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #4 from wakeapp/HUB-316
Browse files Browse the repository at this point in the history
HUB-316
  • Loading branch information
kryakozyablik committed Dec 11, 2019
2 parents c121b49 + 00d726e commit d911334
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [0.4.5] - 2019-12-11
### Fixed
- Fixed priority of normalizers and validators.

## [0.4.4] - 2019-12-11
### Changed
- Improved performance of `SwaggerCachedConfiguration`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@ public function process(ContainerBuilder $container): void

$normalizerQueue = new SplPriorityQueue();

foreach ($container->findTaggedServiceIds(self::TAG) as $id => $attributes) {
foreach ($container->findTaggedServiceIds(self::TAG) as $id => $tags) {
$validatorReference = new Reference($id);
$priority = 0;

$priority = isset($attributes['priority']) ? $attributes['priority'] : 0;
foreach ($tags as $attributes) {
if (isset($attributes['priority'])) {
$priority = $attributes['priority'];
}
}

$normalizerQueue->insert($validatorReference, $priority);
}
Expand Down
9 changes: 7 additions & 2 deletions DependencyInjection/Compiler/SwaggerValidatorCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@ public function process(ContainerBuilder $container): void

$validatorQueue = new SplPriorityQueue();

foreach ($container->findTaggedServiceIds(self::TAG) as $id => $attributes) {
foreach ($container->findTaggedServiceIds(self::TAG) as $id => $tags) {
$validatorReference = new Reference($id);
$priority = 0;

$priority = isset($attributes['priority']) ? $attributes['priority'] : 0;
foreach ($tags as $attributes) {
if (isset($attributes['priority'])) {
$priority = $attributes['priority'];
}
}

$validatorQueue->insert($validatorReference, $priority);
}
Expand Down

0 comments on commit d911334

Please sign in to comment.