Sindbad~EG File Manager

Current Path : /opt/nginxhttpd_/vendor/symfony/monolog-bridge/Processor/
Upload File :
Current File : //opt/nginxhttpd_/vendor/symfony/monolog-bridge/Processor/SwitchUserTokenProcessor.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\Bridge\Monolog\Processor;

use Symfony\Component\Security\Core\Authentication\Token\SwitchUserToken;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;

/**
 * Adds the original security token to the log entry.
 *
 * @author Igor Timoshenko <igor.timoshenko@i.ua>
 */
class SwitchUserTokenProcessor extends AbstractTokenProcessor
{
    /**
     * {@inheritdoc}
     */
    protected function getKey(): string
    {
        return 'impersonator_token';
    }

    /**
     * {@inheritdoc}
     */
    protected function getToken(): ?TokenInterface
    {
        $token = $this->tokenStorage->getToken();

        if ($token instanceof SwitchUserToken) {
            return $token->getOriginalToken();
        }

        return null;
    }
}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists