CodeNode
extends TextNode
in package
FinalYes
Table of Contents
Properties
- $classes : array<string|int, string>
- $language : string|null
- $options : array<string, scalar|null>
- $value : TValue
- $caption : InlineCompoundNode|null
- $emphasizeLines : string|null
- $startingLineNumber : int|null
Methods
- __construct() : mixed
- getCaption() : InlineCompoundNode|null
- getClasses() : array<string|int, string>
- getClassesString() : string
- getEmphasizeLines() : string|null
- getLanguage() : string|null
- getOption() : mixed
- getOptions() : array<string, scalar|null>
- getStartingLineNumber() : int|null
- getValue() : TValue
- hasOption() : bool
- setCaption() : void
- setClasses() : void
- Normalizes class names following the rules of identifier-normalization
- setEmphasizeLines() : void
- setLanguage() : void
- setStartingLineNumber() : void
- setValue() : void
- toString() : string
- withKeepExistingOptions() : static
- Adds $options as default options without overriding any options already set.
- withOptions() : static
- normalizeLines() : string
Properties
$classes
protected
array<string|int, string>
$classes
= []
$language
protected
string|null
$language
= null
$options
protected
array<string, scalar|null>
$options
= []
$value
protected
TValue
$value
$caption
private
InlineCompoundNode|null
$caption
= null
$emphasizeLines
private
string|null
$emphasizeLines
= null
$startingLineNumber
private
int|null
$startingLineNumber
= null
The line number to start counting from and display, or null to hide line numbers
Methods
__construct()
public
__construct(array<string|int, string> $lines[, string|null $language = null ]) : mixed
Parameters
- $lines : array<string|int, string>
- $language : string|null = null
getCaption()
public
getCaption() : InlineCompoundNode|null
Return values
InlineCompoundNode|nullgetClasses()
public
getClasses() : array<string|int, string>
Return values
array<string|int, string>getClassesString()
public
getClassesString() : string
Return values
stringgetEmphasizeLines()
public
getEmphasizeLines() : string|null
Return values
string|nullgetLanguage()
public
getLanguage() : string|null
Return values
string|nullgetOption()
public
getOption(string $name[, TType|null $default = null ]) : mixed
Parameters
- $name : string
- $default : TType|null = null
Tags
getOptions()
public
getOptions() : array<string, scalar|null>
Return values
array<string, scalar|null>getStartingLineNumber()
public
getStartingLineNumber() : int|null
Return values
int|nullgetValue()
public
getValue() : TValue
Return values
TValuehasOption()
public
hasOption(string $name) : bool
Parameters
- $name : string
Return values
boolsetCaption()
public
setCaption(InlineCompoundNode|null $caption) : void
Parameters
- $caption : InlineCompoundNode|null
setClasses()
Normalizes class names following the rules of identifier-normalization
public
setClasses(array<string|int, string> $classes) : void
Parameters
- $classes : array<string|int, string>
Tags
setEmphasizeLines()
public
setEmphasizeLines(string|null $emphasizeLines) : void
Parameters
- $emphasizeLines : string|null
setLanguage()
public
setLanguage([string|null $language = null ]) : void
Parameters
- $language : string|null = null
setStartingLineNumber()
public
setStartingLineNumber(int|null $lineNumber) : void
Parameters
- $lineNumber : int|null
setValue()
public
setValue(TValue $value) : void
Parameters
- $value : TValue
toString()
public
toString() : string
Return values
stringwithKeepExistingOptions()
Adds $options as default options without overriding any options already set.
public
withKeepExistingOptions(array<string, scalar|null> $options) : static
Parameters
- $options : array<string, scalar|null>
Return values
staticwithOptions()
public
withOptions(array<string, scalar|null> $options) : static
Parameters
- $options : array<string, scalar|null>
Return values
staticnormalizeLines()
protected
static normalizeLines(array<string|int, string> $lines) : string
Parameters
- $lines : array<string|int, string>