abstract |
---|
Methods | ||
---|---|---|
public
|
__construct(array $options = [])
|
# |
protected
|
resetState()
|
# |
protected
|
setIndentLevel(int $level)
|
# |
protected
|
indent()
|
# |
protected
|
outdent()
|
# |
public
|
prettyPrint(Node[] $stmts): string
|
# |
public
|
prettyPrintExpr(Expr $node): string
|
# |
public
|
prettyPrintFile(Node[] $stmts): string
|
# |
protected
|
preprocessNodes(Node[] $nodes)
|
# |
protected
|
handleMagicTokens(string $str): string
|
# |
protected
|
pStmts(Node[] $nodes, bool $indent = true): string
|
# |
protected
|
pInfixOp(string $class, Node $leftNode, string $operatorString, Node $rightNode): string
|
# |
protected
|
pPrefixOp(string $class, string $operatorString, Node $node): string
|
# |
protected
|
pPostfixOp(string $class, Node $node, string $operatorString): string
|
# |
protected
|
pPrec(Node $node, int $parentPrecedence, int $parentAssociativity, int $childPosition): string
|
# |
protected
|
pImplode(Node[] $nodes, string $glue = ''): string
|
# |
protected
|
pCommaSeparated(Node[] $nodes): string
|
# |
protected
|
pCommaSeparatedMultiline(Node[] $nodes, bool $trailingComma): string
|
# |
protected
|
pComments(Comment[] $comments): string
|
# |
public
|
printFormatPreserving(Node[] $stmts, Node[] $origStmts, array $origTokens): string
|
# |
protected
|
pFallback(Node $node)
|
# |
protected
|
p(Node $node, bool $parentFormatPreserved = false): string
|
# |
protected
|
pArray(
array $nodes,
array $origNodes,
int &$pos,
int $indentAdjustment,
string $parentNodeType,
string $subNodeName,
null|int $fixup,
): null|string
|
# |
protected
|
pFixup(int $fixup, Node $subNode, string|null $parentClass, int $subStartPos, int $subEndPos): string
|
# |
protected
|
safeAppend(string &$str, string $append)
|
# |
protected
|
callLhsRequiresParens(Node $node): bool
|
# |
protected
|
dereferenceLhsRequiresParens(Node $node): bool
|
# |
protected
|
staticDereferenceLhsRequiresParens(Node $node): bool
|
# |
protected
|
newOperandRequiresParens(Node $node): bool
|
# |
protected
|
pModifiers(int $modifiers): string
|
# |
protected
|
isMultiline((Node|null)[] $nodes): bool
|
# |
protected
|
initializeLabelCharMap()
|
# |
protected
|
initializeNodeListDiffer()
|
# |
protected
|
initializeFixupMap()
|
# |
protected
|
initializeRemovalMap()
|
# |
protected
|
initializeInsertionMap()
|
# |
protected
|
initializeListInsertionMap()
|
# |
protected
|
initializeEmptyListInsertionMap()
|
# |
protected
|
initializeModifierChangeMap()
|
# |
Constants | ||
---|---|---|
public
|
FIXUP_PREC_LEFT = 0
|
# |
public
|
FIXUP_PREC_RIGHT = 1
|
# |
public
|
FIXUP_CALL_LHS = 2
|
# |
public
|
FIXUP_DEREF_LHS = 3
|
# |
public
|
FIXUP_BRACED_NAME = 4
|
# |
public
|
FIXUP_VAR_BRACED_NAME = 5
|
# |
public
|
FIXUP_ENCAPSED = 6
|
# |
public
|
FIXUP_NEW = 7
|
# |
public
|
FIXUP_STATIC_DEREF_LHS = 8
|
# |
Properties | |||
---|---|---|---|
protected
|
|
$precedenceMap = [
Pow::class => [0, 1],
BitwiseNot::class => [10, 1],
PreInc::class => [10, 1],
PreDec::class => [10, 1],
PostInc::class => [10, -1],
PostDec::class => [10, -1],
UnaryPlus::class => [10, 1],
UnaryMinus::class => [10, 1],
Int_::class => [10, 1],
Double::class => [10, 1],
String_::class => [10, 1],
Array_::class => [10, 1],
Object_::class => [10, 1],
Bool_::class => [10, 1],
Unset_::class => [10, 1],
ErrorSuppress::class => [10, 1],
Instanceof_::class => [20, 0],
BooleanNot::class => [30, 1],
Mul::class => [40, -1],
Div::class => [40, -1],
Mod::class => [40, -1],
Plus::class => [50, -1],
Minus::class => [50, -1],
Concat::class => [50, -1],
ShiftLeft::class => [60, -1],
ShiftRight::class => [60, -1],
Smaller::class => [70, 0],
SmallerOrEqual::class => [70, 0],
Greater::class => [70, 0],
GreaterOrEqual::class => [70, 0],
Equal::class => [80, 0],
NotEqual::class => [80, 0],
Identical::class => [80, 0],
NotIdentical::class => [80, 0],
Spaceship::class => [80, 0],
BitwiseAnd::class => [90, -1],
BitwiseXor::class => [100, -1],
BitwiseOr::class => [110, -1],
BooleanAnd::class => [120, -1],
BooleanOr::class => [130, -1],
Coalesce::class => [140, 1],
Ternary::class => [150, 0],
Assign::class => [160, 1],
AssignRef::class => [160, 1],
Plus::class => [160, 1],
Minus::class => [160, 1],
Mul::class => [160, 1],
Div::class => [160, 1],
Concat::class => [160, 1],
Mod::class => [160, 1],
BitwiseAnd::class => [160, 1],
BitwiseOr::class => [160, 1],
BitwiseXor::class => [160, 1],
ShiftLeft::class => [160, 1],
ShiftRight::class => [160, 1],
Pow::class => [160, 1],
Coalesce::class => [160, 1],
YieldFrom::class => [165, 1],
Print_::class => [168, 1],
LogicalAnd::class => [170, -1],
LogicalXor::class => [180, -1],
LogicalOr::class => [190, -1],
Include_::class => [200, -1],
]
|
# |
protected
|
int
|
$indentLevel
|
# |
protected
|
string
|
$nl
|
# |
protected
|
string
|
$docStringEndToken
|
# |
protected
|
bool
|
$canUseSemicolonNamespaces
|
# |
protected
|
array
|
$options
|
# |
protected
|
TokenStream
|
$origTokens
|
# |
protected
|
Differ
|
$nodeListDiffer
|
# |
protected
|
bool[]
|
$labelCharMap
|
# |
protected
|
int[][]
|
$fixupMap
|
# |
protected
|
int[][]
|
$removalMap
|
# |
protected
|
mixed[]
|
$insertionMap
|
# |
protected
|
string[]
|
$listInsertionMap
|
# |
protected
|
|
$emptyListInsertionMap
|
# |
protected
|
int[]
|
$modifierChangeMap
|
# |