/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/Security/Http/AccessToken/ChainAccessTokenExtractor.php
41 строка
1 KB
Florent Morselli
[Security] Access Token Authenticator
10 авг 2022, 13:08
Не верифицирован
10 авг 2022, 13:08
e5873e8
Код
Авторство
О чём код?
<?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\Http\AccessToken; use Symfony\Component\HttpFoundation\Request; /** * The token extractor retrieves the token from a request. * * @author Florent Morselli <florent.morselli@spomky-labs.com> */ final class ChainAccessTokenExtractor implements AccessTokenExtractorInterface { /** * @param AccessTokenExtractorInterface[] $accessTokenExtractors */ public function __construct( private readonly iterable $accessTokenExtractors, ) { } public function extractAccessToken(Request $request): ?string { foreach ($this->accessTokenExtractors as $extractor) { if ($accessToken = $extractor->extractAccessToken($request)) { return $accessToken; } } return null; } }