Pad
class Pad extends StringMutator (View source)
Pads a string to a given length with another string with specified direction.
Traits
Properties
protected | $encoding | from UsesEncoding |
Methods
__construct(int $length, string $string = ' ', StringDirection $direction = StringDirection::Right, string $encoding = null)
No description
static Pad
make(int $length, string $string = ' ', StringDirection $direction = StringDirection::Right, string $encoding = null)
No description
string
mutateString(string $value)
No description
Details
__construct(int $length, string $string = ' ', StringDirection $direction = StringDirection::Right, string $encoding = null)
No description
static Pad
both(int $length, string $string = ' ', string $encoding = null)
No description
protected string|null
getEncoding(string $input = null)
No description
static Pad
left(int $length, string $string = ' ', string $encoding = null)
No description
static Pad
make(int $length, string $string = ' ', StringDirection $direction = StringDirection::Right, string $encoding = null)
No description
final mixed
mutate(mixed $value)
Mutate the input value.
protected string
mutateString(string $value)
No description
protected string
resolveStringInput(mixed $value)
No description
static Pad
right(int $length, string $string = ' ', string $encoding = null)
No description
protected void
setEncoding(string|null $encoding)
No description
protected void
validateEncoding(string|null $encoding)
No description