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

25 lines
665 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\Data2DTO\Transformer\Meta;
use Rinsvent\Data2DTO\Transformer\TransformerInterface;
class ClassObjectTransformer implements TransformerInterface
{
/**
* @param array|null $data
* @param ClassData $meta
*/
public function transform(&$data, Meta $meta): void
{
if ($data === null) {
return;
}
$object = new HelloClassTransformersRequest2();
$object->surname = '98789';
$data = $object;
}
}