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;
|
2022-04-02 10:32:55 +03:00
|
|
|
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
|
|
|
|
*/
|
2022-04-02 10:32:55 +03:00
|
|
|
public function transform(mixed $data, Meta $meta): mixed
|
2021-08-19 19:13:45 +03:00
|
|
|
{
|
|
|
|
if ($data === null) {
|
2022-04-02 10:32:55 +03:00
|
|
|
return $data;
|
2021-08-19 19:13:45 +03:00
|
|
|
}
|
|
|
|
$object = new HelloClassTransformersRequest2();
|
|
|
|
$object->surname = '98789';
|
2022-04-02 10:32:55 +03:00
|
|
|
return $object;
|
2021-08-19 19:13:45 +03:00
|
|
|
}
|
|
|
|
}
|