/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/BrowserKit/Tests/TestClient.php
57 строк
1 KB
Dariusz Ruminski
chore: heredoc indentation as of PHP 7.3
10 авг 2025, 01:28
10 авг 2025, 01:28
4a25a6a
Код
Авторство
О чём код?
<?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\BrowserKit\Tests; use Symfony\Component\BrowserKit\AbstractBrowser; use Symfony\Component\BrowserKit\Response; class TestClient extends AbstractBrowser { protected ?Response $nextResponse = null; protected string $nextScript; public function setNextResponse(Response $response) { $this->nextResponse = $response; } public function setNextScript(string $script) { $this->nextScript = $script; } protected function doRequest(object $request): Response { if (null === $this->nextResponse) { return new Response(); } $response = $this->nextResponse; $this->nextResponse = null; return $response; } protected function getScript(object $request): string { $r = new \ReflectionClass(Response::class); $path = $r->getFileName(); return <<<EOF <?php require_once('$path'); echo serialize($this->nextScript); EOF; } }