data2dto/src/Transformer/TrimTransformer.php
2021-08-07 16:58:27 +07:00

18 lines
355 B
PHP

<?php
namespace Rinsvent\Data2DTO\Transformer;
class TrimTransformer implements TransformerInterface
{
/**
* @param string|null $data
* @param Trim $meta
*/
public function transform(&$data, Meta $meta): void
{
if ($data === null) {
return;
}
$data = trim($data, $meta->characters);
}
}