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.2
No related merge requests found
......@@ -5,7 +5,6 @@ declare(strict_types=1);
namespace EcPhp\EuLoginBundle\Security\Core\User;
use EcPhp\CasBundle\Security\Core\User\CasUserInterface;
use loophp\collection\Collection;
final class EuLoginUser implements EuLoginUserInterface
{
......@@ -120,14 +119,15 @@ final class EuLoginUser implements EuLoginUserInterface
public function getExtendedAttributes(): array
{
return Collection::fromIterable($this->user->getAttribute('extendedAttributes', []))
->map(
static function (array $item): array {
return [$item['@attributes']['name'] => $item['attributeValue']];
}
)
->unwrap()
->all();
return array_reduce(
$this->user->getAttribute('extendedAttributes', []),
static function (array $carry, array $item): array {
$carry[$item['@attributes']['name']] = $item['attributeValue'];
return $carry;
},
[]
);
}
/**
......
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