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 (array) $this->get('attributes', []);
public function getPassword(): ?string
return null;
public function getPgt(): ?string
return $this->get('proxyGrantingTicket');
* @return string[]
public function getRoles(): array
return ['ROLE_CAS_AUTHENTICATED'];
public function getSalt(): ?string
public function getUser(): string
trigger_deprecation(
trigger_deprecation
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
/** @scrutinizer ignore-call */
'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');
* Get the storage.
* @return array<mixed>
private function getStorage(): array
return $this->storage;