CodeHelper
class CodeHelper extends Helper
Properties
protected | $charset | | |
protected | $fileLinkFormat | | |
protected | $rootDir | | |
Methods
Details
setCharset(string $charset)
Sets the default charset.
Parameters
string | $charset | The charset |
string
getCharset()
Gets the default charset.
Return Value
string | The default charset |
__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 |
string
formatArgsAsText(array $args)
Formats an array as a string.
Parameters
array | $args | The argument array |
Return Value
abbrClass($class)
Parameters
abbrMethod($method)
Parameters
Formats an array as a string.
Parameters
array | $args | The argument array |
Return Value
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
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
getFileLink(string $file, int $line)
Returns the link for a given file/line pair.
Parameters
string | $file | An absolute file path |
int | $line | The line number |
Return Value
formatFileFromText($text)
Parameters
string
getName()
Returns the canonical name of this helper.
Return Value
string | The canonical name |
static protected
fixCodeMarkup($line)
Parameters