18 lines
408 B
PHP
18 lines
408 B
PHP
<?php
|
|
|
|
namespace Ulmus\SearchRequest\Attribute\PropertyValueModifier;
|
|
|
|
use Ulmus\SearchRequest\Attribute\PropertyValueModifier;
|
|
|
|
#[\Attribute(\Attribute::TARGET_PROPERTY)]
|
|
class Trim extends PropertyValueModifier
|
|
{
|
|
public function __construct(
|
|
public string $characters = ' \t',
|
|
) {}
|
|
|
|
public function run(mixed $value) : mixed
|
|
{
|
|
return trim($value, $this->characters);
|
|
}
|
|
} |