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

trying to fix phpunit deprecation error

parent c740dc5a
No related branches found
No related tags found
No related merge requests found
Pipeline #232336 passed
...@@ -55,21 +55,28 @@ abstract class AbstractAuthorizationService implements ContextAwareNormalizerInt ...@@ -55,21 +55,28 @@ abstract class AbstractAuthorizationService implements ContextAwareNormalizerInt
{ {
$this->userAuthorizationChecker = new AuthorizationExpressionChecker($mux); $this->userAuthorizationChecker = new AuthorizationExpressionChecker($mux);
$this->currentAuthorizationUser = new AuthorizationUser($userSession, $this->userAuthorizationChecker); $this->currentAuthorizationUser = new AuthorizationUser($userSession, $this->userAuthorizationChecker);
$this->loadConfig(); $this->loadConfig();
} }
/**
* Method for bundle config injection. Don't call in your code (use @see AbstractAuthorizationService::configure()).
*/
public function setConfig(array $config) public function setConfig(array $config)
{ {
$this->config = $config[AuthorizationConfigDefinition::AUTHORIZATION_CONFIG_NODE] ?? []; $this->config = $config[AuthorizationConfigDefinition::AUTHORIZATION_CONFIG_NODE] ?? [];
$this->loadConfig(); $this->loadConfig();
} }
public function configure(array $roleMapping = [], array $attributeMapping = []): void public function configure(array $roles = [], array $attributes = [], array $entities = []): void
{ {
$this->config = [ $this->config = [
AuthorizationConfigDefinition::ROLES_CONFIG_NODE => $roleMapping, AuthorizationConfigDefinition::ROLES_CONFIG_NODE => $roles,
AuthorizationConfigDefinition::ATTRIBUTES_CONFIG_NODE => $attributeMapping, AuthorizationConfigDefinition::ATTRIBUTES_CONFIG_NODE => $attributes,
AuthorizationConfigDefinition::ENTITIES_CONFIG_NODE => $entities,
]; ];
$this->loadConfig(); $this->loadConfig();
} }
...@@ -105,6 +112,8 @@ abstract class AbstractAuthorizationService implements ContextAwareNormalizerInt ...@@ -105,6 +112,8 @@ abstract class AbstractAuthorizationService implements ContextAwareNormalizerInt
/** /**
* {@inheritdoc} * {@inheritdoc}
*
* @return array|string|int|float|bool|\ArrayObject|null
*/ */
public function normalize($object, $format = null, array $context = []) public function normalize($object, $format = null, array $context = [])
{ {
...@@ -144,6 +153,8 @@ abstract class AbstractAuthorizationService implements ContextAwareNormalizerInt ...@@ -144,6 +153,8 @@ abstract class AbstractAuthorizationService implements ContextAwareNormalizerInt
} }
/** /**
* {@inheritdoc}
*
* @return mixed * @return mixed
*/ */
public function denormalize($data, string $type, string $format = null, array $context = []) public function denormalize($data, string $type, string $format = null, array $context = [])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment