Skip to content

Commit

Permalink
Remove dependency to loophp/collection.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Aug 7, 2020
1 parent 249503f commit 4be7a54
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Security/Core/User/EuLoginUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace EcPhp\EuLoginBundle\Security\Core\User;

use EcPhp\CasBundle\Security\Core\User\CasUserInterface;
use loophp\collection\Collection;

final class EuLoginUser implements EuLoginUserInterface
{
Expand Down Expand Up @@ -120,14 +119,15 @@ public function getEmployeeType(): ?string

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;
},
[]
);
}

/**
Expand Down

0 comments on commit 4be7a54

Please sign in to comment.