mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-23 04:14:12 +01:00
- Add Symfony Form Component - Add Symfony CSRF security component - Add iTop default form template - Add Twig debug extension to Twig Environment - Add iTop abstract controller facility to get form builder - Add Twig filter to make trans an alias of dict_s filter
96 lines
1.8 KiB
PHP
96 lines
1.8 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of the Symfony package.
|
|
*
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Symfony\Component\Security\Core\Authentication\Token;
|
|
|
|
use Symfony\Component\Security\Core\User\UserInterface;
|
|
|
|
/**
|
|
* @author Wouter de Jong <wouter@wouterj.nl>
|
|
*/
|
|
class NullToken implements TokenInterface
|
|
{
|
|
public function __toString(): string
|
|
{
|
|
return '';
|
|
}
|
|
|
|
public function getRoleNames(): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
public function getUser(): ?UserInterface
|
|
{
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* @return never
|
|
*/
|
|
public function setUser(UserInterface $user)
|
|
{
|
|
throw new \BadMethodCallException('Cannot set user on a NullToken.');
|
|
}
|
|
|
|
public function getUserIdentifier(): string
|
|
{
|
|
return '';
|
|
}
|
|
|
|
/**
|
|
* @return void
|
|
*/
|
|
public function eraseCredentials()
|
|
{
|
|
}
|
|
|
|
public function getAttributes(): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
/**
|
|
* @return never
|
|
*/
|
|
public function setAttributes(array $attributes)
|
|
{
|
|
throw new \BadMethodCallException('Cannot set attributes of NullToken.');
|
|
}
|
|
|
|
public function hasAttribute(string $name): bool
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public function getAttribute(string $name): mixed
|
|
{
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* @return never
|
|
*/
|
|
public function setAttribute(string $name, mixed $value)
|
|
{
|
|
throw new \BadMethodCallException('Cannot add attribute to NullToken.');
|
|
}
|
|
|
|
public function __serialize(): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
public function __unserialize(array $data): void
|
|
{
|
|
}
|
|
}
|