for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace drupol\CasBundle\Security\Core\User;
use LogicException;
/**
* Class CasUser.
*/
final class CasUser implements CasUserInterface
{
* The user storage.
*
* @var array
private $storage;
* CasUser constructor.
* @param array $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()
public function getPgt(): ?string
return $this->get('proxyGrantingTicket');
public function getRoles()
return ['ROLE_CAS_AUTHENTICATED'];
public function getSalt()
throw new LogicException('Not implemented.');
public function getUser(): string
return $this->get('user');
return $this->get('user')
null
string
public function getUsername()
return $this->getUser();
* Get the storage.
* @return array
private function getStorage()
return $this->storage;