data2dto/tests/unit/Converter/fixtures/FillTest/Transformer/ClassObjectTransformer.php

25 lines
682 B
PHP
Raw Normal View History

2021-08-19 19:13:45 +03:00
<?php
namespace Rinsvent\Data2DTO\Tests\unit\Converter\fixtures\FillTest\Transformer;
use Rinsvent\Data2DTO\Tests\unit\Converter\fixtures\FillTest\HelloClassTransformersRequest2;
use Rinsvent\Transformer\Transformer\Meta;
use Rinsvent\Transformer\Transformer\TransformerInterface;
2021-08-19 19:13:45 +03:00
class ClassObjectTransformer implements TransformerInterface
{
/**
* @param array|null $data
* @param ClassData $meta
*/
public function transform(mixed $data, Meta $meta): mixed
2021-08-19 19:13:45 +03:00
{
if ($data === null) {
return $data;
2021-08-19 19:13:45 +03:00
}
$object = new HelloClassTransformersRequest2();
$object->surname = '98789';
return $object;
2021-08-19 19:13:45 +03:00
}
}