/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/ObjectMapper/Tests/Fixtures/ClassMap/BasePaymentView.php
28 строк
707 B
Florent Blaison
[ObjectMapper] Keep the class-level transform/if of the target's #[Map] in the reverse class-map factory
23 июл 2026, 08:41
23 июл 2026, 08:41
6749888
Код
Авторство
О чём код?
<?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\ObjectMapper\Tests\Fixtures\ClassMap; use Symfony\Component\ObjectMapper\Attribute\Map; #[Map(source: BasePayment::class, transform: [self::class, 'fromPayment'])] final class BasePaymentView { public function __construct( public readonly int $amountCents, ) { } public static function fromPayment(mixed $value, object $source, ?object $target): self { return new self($source->amount->cents); } }