Final Class Yiisoft\Hydrator\Attribute\Parameter\RightTrim
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
Strip whitespace (or other characters) from the end of a resolved string value.
In multibyte mode, Unicode whitespace characters, such as U+00A0 (no-break space), are stripped as well.
It requires the mb_rtrim() function provided by the mbstring PHP extension since PHP 8.4, or by the
symfony/polyfill-mbstring package on earlier versions.
See also:
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $characters | ?string | Yiisoft\ |
|
| $encoding | ?string | Yiisoft\ |
|
| $multibyte | ?bool | Yiisoft\ |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| getResolver() | Yiisoft\ |
Property Details
Method Details
| public mixed __construct ( string|null $characters = null, boolean|null $multibyte = null, string|null $encoding = null ) | ||
| $characters | string|null |
The list of all characters that you want to be stripped. With |
| $multibyte | boolean|null |
Whether to use multibyte-aware trimming. |
| $encoding | string|null |
The encoding to use in multibyte mode. |
public function __construct(
public readonly ?string $characters = null,
public readonly ?bool $multibyte = null,
public readonly ?string $encoding = null,
) {
TrimCharacters::checkMultibyteFunctionsExist($multibyte);
}
| public string getResolver ( ) |
public function getResolver(): string
{
return RightTrimResolver::class;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.