CodeNode
extends Node
in package
Table of Contents
- $classes : array<string|int, string>
- $language : string|null
- $raw : bool
- $value : Node|callable|string|null
- $options : array<string|int, mixed>
- $startingLineNumber : int|null
- __construct() : mixed
- getClasses() : array<string|int, string>
- getClassesString() : string
- getLanguage() : string|null
- getOption() : mixed|null
- getOptions() : array<string, mixed>
- getStartingLineNumber() : int|null
- getValue() : Node|callable|string|null
- getValueString() : string
- isRaw() : bool
- setClasses() : void
- setLanguage() : void
- setRaw() : void
- setStartingLineNumber() : void
- setValue() : void
- withOptions() : self
- normalizeLines() : string
Properties
$classes
protected
array<string|int, string>
$classes
= []
$language
protected
string|null
$language
$raw
protected
bool
$raw
= false
$value
protected
Node|callable|string|null
$value
$options
private
array<string|int, mixed>
$options
$startingLineNumber
private
int|null
$startingLineNumber
The line number to start counting from and display, or null to hide line numbers
Methods
__construct()
public
__construct(array<string|int, string> $lines) : mixed
Parameters
- $lines : array<string|int, string>
Return values
mixed —getClasses()
public
getClasses() : array<string|int, string>
Return values
array<string|int, string> —getClassesString()
public
getClassesString() : string
Return values
string —getLanguage()
public
getLanguage() : string|null
Return values
string|null —getOption()
public
getOption(string $name[, mixed|null $default = null ]) : mixed|null
Parameters
- $name : string
- $default : mixed|null = null
Return values
mixed|null —getOptions()
public
getOptions() : array<string, mixed>
Return values
array<string, mixed> —getStartingLineNumber()
public
getStartingLineNumber() : int|null
Return values
int|null —getValue()
public
getValue() : Node|callable|string|null
Return values
Node|callable|string|null —getValueString()
public
getValueString() : string
Return values
string —isRaw()
public
isRaw() : bool
Return values
bool —setClasses()
public
setClasses(array<string|int, string> $classes) : void
Parameters
- $classes : array<string|int, string>
Return values
void —setLanguage()
public
setLanguage([string|null $language = null ]) : void
Parameters
- $language : string|null = null
Return values
void —setRaw()
public
setRaw(bool $raw) : void
Parameters
- $raw : bool
Return values
void —setStartingLineNumber()
public
setStartingLineNumber(int|null $lineNumber) : void
Parameters
- $lineNumber : int|null
Return values
void —setValue()
public
setValue(Node|callable|string|null $value) : void
Parameters
- $value : Node|callable|string|null
Return values
void —withOptions()
public
withOptions(array<string, mixed> $options) : self
Parameters
- $options : array<string, mixed>
Return values
self —normalizeLines()
protected
normalizeLines(array<string|int, string> $lines) : string
Parameters
- $lines : array<string|int, string>