0 follower

Final Class Yiisoft\Hydrator\Attribute\Parameter\ToArrayOfStrings

InheritanceYiisoft\Hydrator\Attribute\Parameter\ToArrayOfStrings
ImplementsYiisoft\Hydrator\Attribute\Parameter\ParameterAttributeInterface

Casts the resolved value to array of strings.

Property Details

Hide inherited properties

$removeEmpty public property
public boolean $removeEmpty false
$separator public property
public string $separator '\\R'
$splitResolvedValue public property
$trim public property
public boolean $trim false

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( boolean $trim false, boolean $removeEmpty false, boolean $splitResolvedValue true, string $separator '\\R' )
$trim boolean

Trim each string of array.

$removeEmpty boolean

Remove empty strings from array.

$splitResolvedValue boolean

Split non-array resolved value to array of strings by {@see $separator}.

$separator string

The boundary string. It is a part of regular expression so should be taken into account or properly escaped with {@see \Yiisoft\Hydrator\Attribute\Parameter\preg_quote()}.

                public function __construct(
    public readonly bool $trim = false,
    public readonly bool $removeEmpty = false,
    public readonly bool $splitResolvedValue = true,
    public readonly string $separator = '\R',
) {
}

            
getResolver() public method

public string getResolver ( )

                public function getResolver(): string
{
    return ToArrayOfStringsResolver::class;
}