for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace EcPhp\CasBundle\Security\Core\User;
/**
* Class CasUser.
*/
final class CasUser implements CasUserInterface
{
* The user storage.
*
* @var array<mixed>
private $storage;
* CasUser constructor.
* @param array<mixed> $data
public function __construct(array $data)
$this->storage = $data;
}
* {@inheritdoc}
public function eraseCredentials(): void
public function get(string $key, $default = null)
return $this->getStorage()[$key] ?? $default;
public function getAttribute(string $key, $default = null)
return $this->getStorage()['attributes'][$key] ?? $default;
public function getAttributes(): array
return $this->get('attributes', []);
public function getPassword(): ?string
return null;
public function getPgt(): ?string
return $this->get('proxyGrantingTicket');
public function getRoles(): array
return ['ROLE_CAS_AUTHENTICATED'];
public function getSalt(): ?string
public function getUser(): string
trigger_deprecation(
'ecphp/cas-bundle',
'2.1.2',
'The method "%s::getUser()" is deprecated, use %s::getUsername() instead.',
CasUserInterface::class
);
return $this->getUsername();
public function getUsername(): string
return $this->get('user');
return $this->get('user')
null
string
* Get the storage.
* @return array<mixed>
private function getStorage(): array
return $this->storage;