Documentation

SignText
in package

Table of Contents

LINE_COUNT  = 4
$lines  : array<string|int, string>
__construct()  : mixed
fromBlob()  : SignText
Parses sign lines from the given string blob.
getLine()  : string
Returns the sign line at the given offset.
getLines()  : array<string|int, string>
Returns an array of lines currently on the sign.
checkLineIndex()  : void

Constants

Properties

$lines

private array<string|int, string> $lines

Methods

__construct()

public __construct([array<string|int, string>|null $lines = null ]) : mixed
Parameters
$lines : array<string|int, string>|null = null

index-sensitive; omitting an index will leave it unchanged

Tags
throws
InvalidArgumentException

if the array size is greater than 4

throws
InvalidArgumentException

if invalid keys (out of bounds or string) are found in the array

throws
InvalidArgumentException

if any line is not valid UTF-8 or contains a newline

Return values
mixed

fromBlob()

Parses sign lines from the given string blob.

public static fromBlob(string $blob) : SignText

TODO: add a strict mode for this

Parameters
$blob : string
Tags
throws
InvalidArgumentException

if the text is not valid UTF-8

Return values
SignText

getLine()

Returns the sign line at the given offset.

public getLine(int $index) : string
Parameters
$index : int
Tags
throws
InvalidArgumentException
Return values
string

getLines()

Returns an array of lines currently on the sign.

public getLines() : array<string|int, string>
Return values
array<string|int, string>

checkLineIndex()

private checkLineIndex(int|string $index) : void
Parameters
$index : int|string
Return values
void

Search results