/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/HttpClient/Tests/Response/HttplugPromiseTest.php
36 строк
1 KB
Dariusz Ruminski
PHP CS Fixer: enable static_lambda
19 дек 2025, 11:33
19 дек 2025, 11:33
3274fbc
Код
Авторство
О чём код?
<?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\HttpClient\Tests\Response; use GuzzleHttp\Promise\Promise; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpClient\Response\HttplugPromise; class HttplugPromiseTest extends TestCase { public function testComplexNesting() { $mkPromise = static function ($result): HttplugPromise { $guzzlePromise = new Promise(static function () use (&$guzzlePromise, $result) { $guzzlePromise->resolve($result); }); return new HttplugPromise($guzzlePromise); }; $promise1 = $mkPromise('result'); $promise2 = $promise1->then($mkPromise); $promise3 = $promise2->then(static fn ($result) => $result); $this->assertSame('result', $promise3->wait()); } }