Skip to content
Snippets Groups Projects
Commit 49ded510 authored by Groß-Vogt, Tobias's avatar Groß-Vogt, Tobias
Browse files

localdatapreevent: replace acknowledgeQueryParameter function by tryPopPendingQueryParameter

parent f0ef68de
No related branches found
No related tags found
No related merge requests found
Pipeline #230881 passed
......@@ -109,7 +109,7 @@ abstract class AbstractLocalDataEventSubscriber extends AbstractAuthorizationSer
}
$sourceAttributeName = $attributeMapEntry[self::SOURCE_ATTRIBUTE_KEY];
$localQueryParameters[$sourceAttributeName] = $localDataAttributeValue;
$event->acknowledgeQueryParameter($localDataAttributeName);
$event->tryPopPendingQueryParameter($localDataAttributeName);
}
}
......@@ -182,7 +182,7 @@ abstract class AbstractLocalDataEventSubscriber extends AbstractAuthorizationSer
throw new \RuntimeException(sprintf('child classes must implement the \'%s\' method', __METHOD__));
}
protected function onPreEvent(LocalDataPreEvent $preEvent, array $localQueryParameters)
protected function onPreEvent(LocalDataPreEvent $preEvent, array $mappedQueryParameters)
{
}
......
......@@ -30,9 +30,13 @@ class LocalDataPreEvent extends Event
return $this->queryParametersIn;
}
public function acknowledgeQueryParameter(string $queryParameterName): void
public function tryPopPendingQueryParameter(string $queryParameterName, &$queryParameterValue = null): bool
{
unset($this->queryParametersIn[$queryParameterName]);
if (($queryParameterValue = $this->queryParametersIn[$queryParameterName] ?? null) !== null) {
unset($this->queryParametersIn[$queryParameterName]);
}
return $queryParameterValue !== null;
}
public function getOptions(): array
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment