class CodeHelper extends Helper

Properties

protected $charset
protected $fileLinkFormat
protected $rootDir

Methods

setCharset(string $charset)

Sets the default charset.

from Helper
string
getCharset()

Gets the default charset.

from Helper
__construct(string|FileLinkFormatter $fileLinkFormat, string $rootDir, string $charset)

No description

string
formatArgsAsText(array $args)

Formats an array as a string.

abbrClass($class)

No description

abbrMethod($method)

No description

string
formatArgs(array $args)

Formats an array as a string.

string
fileExcerpt(string $file, int $line)

Returns an excerpt of a code file around the given line number.

string
formatFile(string $file, int $line, string $text = null)

Formats a file path.

string
getFileLink(string $file, int $line)

Returns the link for a given file/line pair.

formatFileFromText($text)

No description

string
getName()

Returns the canonical name of this helper.

static 
fixCodeMarkup($line)

No description

Details

in Helper at line 31
setCharset(string $charset)

Sets the default charset.

Parameters

string $charset The charset

in Helper at line 41
string getCharset()

Gets the default charset.

Return Value

string The default charset

at line 31
__construct(string|FileLinkFormatter $fileLinkFormat, string $rootDir, string $charset)

Parameters

string|FileLinkFormatter $fileLinkFormat The format for links to source files
string $rootDir The project root directory
string $charset The charset

at line 45
string formatArgsAsText(array $args)

Formats an array as a string.

Parameters

array $args The argument array

Return Value

string

at line 50
abbrClass($class)

Parameters

$class

at line 58
abbrMethod($method)

Parameters

$method

at line 79
string formatArgs(array $args)

Formats an array as a string.

Parameters

array $args The argument array

Return Value

string

at line 115
string fileExcerpt(string $file, int $line)

Returns an excerpt of a code file around the given line number.

Parameters

string $file A file path
int $line The selected line number

Return Value

string An HTML string

at line 152
string formatFile(string $file, int $line, string $text = null)

Formats a file path.

Parameters

string $file An absolute file path
int $line The line number
string $text Use this text for the link rather than the file path

Return Value

string

Returns the link for a given file/line pair.

Parameters

string $file An absolute file path
int $line The line number

Return Value

string A link of false

at line 192
formatFileFromText($text)

Parameters

$text

at line 202
string getName()

Returns the canonical name of this helper.

Return Value

string The canonical name

at line 207
static protected fixCodeMarkup($line)

Parameters

$line