OptionNode
extends CompoundNode
in package
implements
LinkTargetNode, MultipleLinkTargetsNode
FinalYes
Describes a command line argument or switch. Option argument names should be enclosed in angle brackets.
https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#directive-option
Table of Contents
Interfaces
Constants
- LINK_TYPE = 'std:option'
Properties
- $classes : array<string|int, string>
- $options : array<string, scalar|null>
- $value : TValue
- $additionalIds : array<string|int, mixed>
- $id : string
- $plainContent : string
Methods
- __construct() : mixed
- addChildNode() : void
- getAdditionalIds() : array<string|int, string>
- getChildren() : array<string|int, TValue>
- getClasses() : array<string|int, string>
- getClassesString() : string
- getId() : string
- getLinkText() : string
- getLinkType() : string
- getOption() : mixed
- getOptions() : array<string, scalar|null>
- getPlainContent() : string
- getValue() : TValue
- hasOption() : bool
- pushChildNode() : void
- removeNode() : self
- replaceNode() : self
- setClasses() : void
- Normalizes class names following the rules of identifier-normalization
- setValue() : void
- withKeepExistingOptions() : static
- Adds $options as default options without overriding any options already set.
- withOptions() : static
Constants
LINK_TYPE
public
mixed
LINK_TYPE
= 'std:option'
Properties
$classes
protected
array<string|int, string>
$classes
= []
$options
protected
array<string, scalar|null>
$options
= []
$value
protected
TValue
$value
$additionalIds read-only
private
array<string|int, mixed>
$additionalIds
$id read-only
private
string
$id
$plainContent read-only
private
string
$plainContent
Methods
__construct()
public
__construct(string $id, string $plainContent, array<string|int, string> $additionalIds[, array<int, Node> $value = [] ]) : mixed
Parameters
- $id : string
- $plainContent : string
- $additionalIds : array<string|int, string>
- $value : array<int, Node> = []
addChildNode()
public
addChildNode(TValue $node) : void
Parameters
- $node : TValue
getAdditionalIds()
public
getAdditionalIds() : array<string|int, string>
Return values
array<string|int, string>getChildren()
public
getChildren() : array<string|int, TValue>
Return values
array<string|int, TValue>getClasses()
public
getClasses() : array<string|int, string>
Return values
array<string|int, string>getClassesString()
public
getClassesString() : string
Return values
stringgetId()
public
getId() : string
Return values
stringgetLinkText()
public
getLinkText() : string
Return values
stringgetLinkType()
public
getLinkType() : string
Return values
stringgetOption()
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>getPlainContent()
public
getPlainContent() : string
Return values
stringgetValue()
public
getValue() : TValue
Return values
TValuehasOption()
public
hasOption(string $name) : bool
Parameters
- $name : string
Return values
boolpushChildNode()
public
pushChildNode(TValue $node) : void
Parameters
- $node : TValue
removeNode()
public
removeNode(int $key) : self
Parameters
- $key : int
Tags
Return values
selfreplaceNode()
public
replaceNode(int $key, TValue $node) : self
Parameters
- $key : int
- $node : TValue
Tags
Return values
selfsetClasses()
Normalizes class names following the rules of identifier-normalization
public
setClasses(array<string|int, string> $classes) : void
Parameters
- $classes : array<string|int, string>
Tags
setValue()
public
setValue(TValue $value) : void
Parameters
- $value : TValue
withKeepExistingOptions()
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>