Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 4be7a548 authored by Pol Dellaiera's avatar Pol Dellaiera
Browse files

Remove dependency to loophp/collection.

parent 249503fd
No related branches found
Tags 2.3.5
No related merge requests found
...@@ -5,7 +5,6 @@ declare(strict_types=1); ...@@ -5,7 +5,6 @@ declare(strict_types=1);
namespace EcPhp\EuLoginBundle\Security\Core\User; namespace EcPhp\EuLoginBundle\Security\Core\User;
use EcPhp\CasBundle\Security\Core\User\CasUserInterface; use EcPhp\CasBundle\Security\Core\User\CasUserInterface;
use loophp\collection\Collection;
final class EuLoginUser implements EuLoginUserInterface final class EuLoginUser implements EuLoginUserInterface
{ {
...@@ -120,14 +119,15 @@ final class EuLoginUser implements EuLoginUserInterface ...@@ -120,14 +119,15 @@ final class EuLoginUser implements EuLoginUserInterface
public function getExtendedAttributes(): array public function getExtendedAttributes(): array
{ {
return Collection::fromIterable($this->user->getAttribute('extendedAttributes', [])) return array_reduce(
->map( $this->user->getAttribute('extendedAttributes', []),
static function (array $item): array { static function (array $carry, array $item): array {
return [$item['@attributes']['name'] => $item['attributeValue']]; $carry[$item['@attributes']['name']] = $item['attributeValue'];
}
) return $carry;
->unwrap() },
->all(); []
);
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment