CloneableInstantiable
ExtendsPhpParser\PrettyPrinterAbstract
Constants
public PhpParser\PrettyPrinterAbstract::FIXUP_BRACED_NAME = 4
public PhpParser\PrettyPrinterAbstract::FIXUP_CALL_LHS = 2
public PhpParser\PrettyPrinterAbstract::FIXUP_DEREF_LHS = 3
public PhpParser\PrettyPrinterAbstract::FIXUP_ENCAPSED = 6
public PhpParser\PrettyPrinterAbstract::FIXUP_PREC_LEFT = 0
public PhpParser\PrettyPrinterAbstract::FIXUP_PREC_RIGHT = 1
public PhpParser\PrettyPrinterAbstract::FIXUP_VAR_BRACED_NAME = 5
Methods
public PhpParser\PrettyPrinterAbstract::__construct(array $options = [])
 

Creates a pretty printer instance using the given options.

Supported options:

  • bool $shortArraySyntax = false: Whether to use [] instead of array() as the default array
                                syntax, if the node does not specify a format.
    
    public PhpParser\PrettyPrinterAbstract::prettyPrint(array $stmts) : string
     

    Pretty prints an array of statements.

    • return string Pretty printed statements
    public PhpParser\PrettyPrinterAbstract::prettyPrintExpr(PhpParser\Node\Expr $node) : string
     

    Pretty prints an expression.

    • return string Pretty printed node
    public PhpParser\PrettyPrinterAbstract::prettyPrintFile(array $stmts) : string
     

    Pretty prints a file of statements (includes the opening <?php tag if it is required).

    • return string Pretty printed statements
    public PhpParser\PrettyPrinterAbstract::printFormatPreserving(array $stmts, array $origStmts, array $origTokens) : string
     

    Perform a format-preserving pretty print of an AST.

    The format preservation is best effort. For some changes to the AST the formatting will not
    be preserved (at least not locally).

    In order to use this method a number of prerequisites must be satisfied:

    • The startTokenPos and endTokenPos attributes in the lexer must be enabled.
    • The CloningVisitor must be run on the AST prior to modification.
    • The original tokens must be provided, using the getTokens() method on the lexer.
    • return string
    Properties
    protected PhpParser\PrettyPrinterAbstract::$canUseSemicolonNamespaces
     
    • var bool Whether semicolon namespaces can be used (i.e. no global namespace is used)
    protected PhpParser\PrettyPrinterAbstract::$docStringEndToken
     
    • var string Token placed at end of doc string to ensure it is followed by a newline.
    protected PhpParser\PrettyPrinterAbstract::$emptyListInsertionMap
    protected PhpParser\PrettyPrinterAbstract::$fixupMap
     
    • var int[][] Map from token classes and subnode names to FIXUP_* constants. This is used during format-preserving prints to place additional parens/braces if necessary.
    protected PhpParser\PrettyPrinterAbstract::$indentLevel
     
    • var int Current indentation level.
    protected PhpParser\PrettyPrinterAbstract::$insertionMap
     
    • var array Map from "{$node->getType()}->{$subNode}" to [$find, $beforeToken, $extraLeft, $extraRight]. $find is an optional token after which the insertion occurs. $extraLeft/Right are optionally added before/after the main insertions.
    protected PhpParser\PrettyPrinterAbstract::$labelCharMap
     
    • var bool[] Map determining whether a certain character is a label character
    protected PhpParser\PrettyPrinterAbstract::$listInsertionMap
     
    • var string[] Map From "{$node->getType()}->{$subNode}" to string that should be inserted between elements of this list subnode.
    protected PhpParser\PrettyPrinterAbstract::$modifierChangeMap
     
    • var int[] Map from "{$node->getType()}->{$subNode}" to token before which the modifiers should be reprinted.
    protected PhpParser\PrettyPrinterAbstract::$nl
     
    • var string Newline including current indentation.
    protected PhpParser\PrettyPrinterAbstract::$nodeListDiffer
     
    • var Internal\Differ Differ for node lists
    protected PhpParser\PrettyPrinterAbstract::$options
     
    • var array Pretty printer options
    protected PhpParser\PrettyPrinterAbstract::$origTokens
     
    • var TokenStream Original tokens for use in format-preserving pretty print
    protected PhpParser\PrettyPrinterAbstract::$precedenceMap
    protected PhpParser\PrettyPrinterAbstract::$removalMap
     
    • var int[][] Map from "{$node->getType()}->{$subNode}" to ['left' => $l, 'right' => $r], where $l and $r specify the token type that needs to be stripped when removing this node.
    Methods
    protected PhpParser\PrettyPrinterAbstract::callLhsRequiresParens(PhpParser\Node $node) : bool
     

    Determines whether the LHS of a call must be wrapped in parenthesis.

    • return bool Whether parentheses are required
    protected containsEndLabel( $string, $label, $atStart = true, $atEnd = true)
    protected PhpParser\PrettyPrinterAbstract::dereferenceLhsRequiresParens(PhpParser\Node $node) : bool
     

    Determines whether the LHS of a dereferencing operation must be wrapped in parenthesis.

    • return bool Whether parentheses are required
    protected encapsedContainsEndLabel(array $parts, $label)
    protected escapeString( $string, $quote)
    protected PhpParser\PrettyPrinterAbstract::handleMagicTokens(string $str) : string
     

    Handles (and removes) no-indent and doc-string-end tokens.

    • return string
    protected PhpParser\PrettyPrinterAbstract::indent()
     

    Increase indentation level.

    protected PhpParser\PrettyPrinterAbstract::initializeEmptyListInsertionMap()
    protected PhpParser\PrettyPrinterAbstract::initializeFixupMap()
     

    Lazily initializes fixup map.

    The fixup map is used to determine whether a certain subnode of a certain node may require
    some kind of "fixup" operation, e.g. the addition of parenthesis or braces.

    protected PhpParser\PrettyPrinterAbstract::initializeInsertionMap()
    protected PhpParser\PrettyPrinterAbstract::initializeLabelCharMap()
     

    Lazily initializes label char map.

    The label char map determines whether a certain character may occur in a label.

    protected PhpParser\PrettyPrinterAbstract::initializeListInsertionMap()
    protected PhpParser\PrettyPrinterAbstract::initializeModifierChangeMap()
    protected PhpParser\PrettyPrinterAbstract::initializeNodeListDiffer()
     

    Lazily initializes node list differ.

    The node list differ is used to determine differences between two array subnodes.

    protected PhpParser\PrettyPrinterAbstract::initializeRemovalMap()
     

    Lazily initializes the removal map.

    The removal map is used to determine which additional tokens should be returned when a
    certain node is replaced by null.

    protected PhpParser\PrettyPrinterAbstract::isMultiline(array $nodes) : bool
     

    Determine whether a list of nodes uses multiline formatting.

    • return bool Whether multiline formatting is used
    protected PhpParser\PrettyPrinterAbstract::outdent()
     

    Decrease indentation level.

    protected PhpParser\PrettyPrinterAbstract::p(PhpParser\Node $node, $parentFormatPreserved = false) : string
     

    Pretty prints a node.

    This method also handles formatting preservation for nodes.

    • return string Pretty printed node
    protected pArg(PhpParser\Node\Arg $node)
    protected PhpParser\PrettyPrinterAbstract::pArray(array $nodes, array $origNodes, int $pos, int $indentAdjustment, string $parentNodeType, string $subNodeName, $fixup)
     

    Perform a format-preserving pretty print of an array.

    • return null|string Result of pretty print or null if cannot preserve formatting
    protected pCallLhs(PhpParser\Node $node)
    protected pClassCommon(PhpParser\Node\Stmt\Class_ $node, $afterClassToken)
    protected PhpParser\PrettyPrinterAbstract::pCommaSeparated(array $nodes) : string
     

    Pretty prints an array of nodes and implodes the printed values with commas.

    • return string Comma separated pretty printed nodes
    protected PhpParser\PrettyPrinterAbstract::pCommaSeparatedMultiline(array $nodes, bool $trailingComma) : string
     

    Pretty prints a comma-separated list of nodes in multiline style, including comments.

    The result includes a leading newline and one level of indentation (same as pStmts).

    • return string Comma separated pretty printed nodes in multiline style
    protected PhpParser\PrettyPrinterAbstract::pComments(array $comments) : string
     

    Prints reformatted text of the passed comments.

    • return string Reformatted text of comments
    protected pConst(PhpParser\Node\Const_ $node)
    protected pDereferenceLhs(PhpParser\Node $node)
    protected pEncapsList(array $encapsList, $quote)
    protected pExpr_Array(PhpParser\Node\Expr\Array_ $node)
    protected pExpr_ArrayDimFetch(PhpParser\Node\Expr\ArrayDimFetch $node)
    protected pExpr_ArrayItem(PhpParser\Node\Expr\ArrayItem $node)
    protected pExpr_ArrowFunction(PhpParser\Node\Expr\ArrowFunction $node)
    protected pExpr_Assign(PhpParser\Node\Expr\Assign $node)
    protected pExpr_AssignOp_BitwiseAnd(PhpParser\Node\Expr\AssignOp\BitwiseAnd $node)
    protected pExpr_AssignOp_BitwiseOr(PhpParser\Node\Expr\AssignOp\BitwiseOr $node)
    protected pExpr_AssignOp_BitwiseXor(PhpParser\Node\Expr\AssignOp\BitwiseXor $node)
    protected pExpr_AssignOp_Coalesce(PhpParser\Node\Expr\AssignOp\Coalesce $node)
    protected pExpr_AssignOp_Concat(PhpParser\Node\Expr\AssignOp\Concat $node)
    protected pExpr_AssignOp_Div(PhpParser\Node\Expr\AssignOp\Div $node)
    protected pExpr_AssignOp_Minus(PhpParser\Node\Expr\AssignOp\Minus $node)
    protected pExpr_AssignOp_Mod(PhpParser\Node\Expr\AssignOp\Mod $node)
    protected pExpr_AssignOp_Mul(PhpParser\Node\Expr\AssignOp\Mul $node)
    protected pExpr_AssignOp_Plus(PhpParser\Node\Expr\AssignOp\Plus $node)
    protected pExpr_AssignOp_Pow(PhpParser\Node\Expr\AssignOp\Pow $node)
    protected pExpr_AssignOp_ShiftLeft(PhpParser\Node\Expr\AssignOp\ShiftLeft $node)
    protected pExpr_AssignOp_ShiftRight(PhpParser\Node\Expr\AssignOp\ShiftRight $node)
    protected pExpr_AssignRef(PhpParser\Node\Expr\AssignRef $node)
    protected pExpr_BinaryOp_BitwiseAnd(PhpParser\Node\Expr\BinaryOp\BitwiseAnd $node)
    protected pExpr_BinaryOp_BitwiseOr(PhpParser\Node\Expr\BinaryOp\BitwiseOr $node)
    protected pExpr_BinaryOp_BitwiseXor(PhpParser\Node\Expr\BinaryOp\BitwiseXor $node)
    protected pExpr_BinaryOp_BooleanAnd(PhpParser\Node\Expr\BinaryOp\BooleanAnd $node)
    protected pExpr_BinaryOp_BooleanOr(PhpParser\Node\Expr\BinaryOp\BooleanOr $node)
    protected pExpr_BinaryOp_Coalesce(PhpParser\Node\Expr\BinaryOp\Coalesce $node)
    protected pExpr_BinaryOp_Concat(PhpParser\Node\Expr\BinaryOp\Concat $node)
    protected pExpr_BinaryOp_Div(PhpParser\Node\Expr\BinaryOp\Div $node)
    protected pExpr_BinaryOp_Equal(PhpParser\Node\Expr\BinaryOp\Equal $node)
    protected pExpr_BinaryOp_Greater(PhpParser\Node\Expr\BinaryOp\Greater $node)
    protected pExpr_BinaryOp_GreaterOrEqual(PhpParser\Node\Expr\BinaryOp\GreaterOrEqual $node)
    protected pExpr_BinaryOp_Identical(PhpParser\Node\Expr\BinaryOp\Identical $node)
    protected pExpr_BinaryOp_LogicalAnd(PhpParser\Node\Expr\BinaryOp\LogicalAnd $node)
    protected pExpr_BinaryOp_LogicalOr(PhpParser\Node\Expr\BinaryOp\LogicalOr $node)
    protected pExpr_BinaryOp_LogicalXor(PhpParser\Node\Expr\BinaryOp\LogicalXor $node)
    protected pExpr_BinaryOp_Minus(PhpParser\Node\Expr\BinaryOp\Minus $node)
    protected pExpr_BinaryOp_Mod(PhpParser\Node\Expr\BinaryOp\Mod $node)
    protected pExpr_BinaryOp_Mul(PhpParser\Node\Expr\BinaryOp\Mul $node)
    protected pExpr_BinaryOp_NotEqual(PhpParser\Node\Expr\BinaryOp\NotEqual $node)
    protected pExpr_BinaryOp_NotIdentical(PhpParser\Node\Expr\BinaryOp\NotIdentical $node)
    protected pExpr_BinaryOp_Plus(PhpParser\Node\Expr\BinaryOp\Plus $node)
    protected pExpr_BinaryOp_Pow(PhpParser\Node\Expr\BinaryOp\Pow $node)
    protected pExpr_BinaryOp_ShiftLeft(PhpParser\Node\Expr\BinaryOp\ShiftLeft $node)
    protected pExpr_BinaryOp_ShiftRight(PhpParser\Node\Expr\BinaryOp\ShiftRight $node)
    protected pExpr_BinaryOp_Smaller(PhpParser\Node\Expr\BinaryOp\Smaller $node)
    protected pExpr_BinaryOp_SmallerOrEqual(PhpParser\Node\Expr\BinaryOp\SmallerOrEqual $node)
    protected pExpr_BinaryOp_Spaceship(PhpParser\Node\Expr\BinaryOp\Spaceship $node)
    protected pExpr_BitwiseNot(PhpParser\Node\Expr\BitwiseNot $node)
    protected pExpr_BooleanNot(PhpParser\Node\Expr\BooleanNot $node)
    protected pExpr_Cast_Array(PhpParser\Node\Expr\Cast\Array_ $node)
    protected pExpr_Cast_Bool(PhpParser\Node\Expr\Cast\Bool_ $node)
    protected pExpr_Cast_Double(PhpParser\Node\Expr\Cast\Double $node)
    protected pExpr_Cast_Int(PhpParser\Node\Expr\Cast\Int_ $node)
    protected pExpr_Cast_Object(PhpParser\Node\Expr\Cast\Object_ $node)
    protected pExpr_Cast_String(PhpParser\Node\Expr\Cast\String_ $node)
    protected pExpr_Cast_Unset(PhpParser\Node\Expr\Cast\Unset_ $node)
    protected pExpr_ClassConstFetch(PhpParser\Node\Expr\ClassConstFetch $node)
    protected pExpr_Clone(PhpParser\Node\Expr\Clone_ $node)
    protected pExpr_Closure(PhpParser\Node\Expr\Closure $node)
    protected pExpr_ClosureUse(PhpParser\Node\Expr\ClosureUse $node)
    protected pExpr_ConstFetch(PhpParser\Node\Expr\ConstFetch $node)
    protected pExpr_Empty(PhpParser\Node\Expr\Empty_ $node)
    protected pExpr_Error(PhpParser\Node\Expr\Error $node)
    protected pExpr_ErrorSuppress(PhpParser\Node\Expr\ErrorSuppress $node)
    protected pExpr_Eval(PhpParser\Node\Expr\Eval_ $node)
    protected pExpr_Exit(PhpParser\Node\Expr\Exit_ $node)
    protected pExpr_FuncCall(PhpParser\Node\Expr\FuncCall $node)
    protected pExpr_Include(PhpParser\Node\Expr\Include_ $node)
    protected pExpr_Instanceof(PhpParser\Node\Expr\Instanceof_ $node)
    protected pExpr_Isset(PhpParser\Node\Expr\Isset_ $node)
    protected pExpr_List(PhpParser\Node\Expr\List_ $node)
    protected pExpr_MethodCall(PhpParser\Node\Expr\MethodCall $node)
    protected pExpr_New(PhpParser\Node\Expr\New_ $node)
    protected pExpr_PostDec(PhpParser\Node\Expr\PostDec $node)
    protected pExpr_PostInc(PhpParser\Node\Expr\PostInc $node)
    protected pExpr_PreDec(PhpParser\Node\Expr\PreDec $node)
    protected pExpr_PreInc(PhpParser\Node\Expr\PreInc $node)
    protected pExpr_Print(PhpParser\Node\Expr\Print_ $node)
    protected pExpr_PropertyFetch(PhpParser\Node\Expr\PropertyFetch $node)
    protected pExpr_ShellExec(PhpParser\Node\Expr\ShellExec $node)
    protected pExpr_StaticCall(PhpParser\Node\Expr\StaticCall $node)
    protected pExpr_StaticPropertyFetch(PhpParser\Node\Expr\StaticPropertyFetch $node)
    protected pExpr_Ternary(PhpParser\Node\Expr\Ternary $node)
    protected pExpr_UnaryMinus(PhpParser\Node\Expr\UnaryMinus $node)
    protected pExpr_UnaryPlus(PhpParser\Node\Expr\UnaryPlus $node)
    protected pExpr_Variable(PhpParser\Node\Expr\Variable $node)
    protected pExpr_Yield(PhpParser\Node\Expr\Yield_ $node)
    protected pExpr_YieldFrom(PhpParser\Node\Expr\YieldFrom $node)
    protected PhpParser\PrettyPrinterAbstract::pFallback(PhpParser\Node $node)
    protected PhpParser\PrettyPrinterAbstract::pFixup(int $fixup, PhpParser\Node $subNode, $parentClass, int $subStartPos, int $subEndPos) : string
     

    Print node with fixups.

    Fixups here refer to the addition of extra parentheses, braces or other characters, that
    are required to preserve program semantics in a certain context (e.g. to maintain precedence
    or because only certain expressions are allowed in certain places).

    • return string Result of fixed-up print of subnode
    protected pIdentifier(PhpParser\Node\Identifier $node)
    protected PhpParser\PrettyPrinterAbstract::pImplode(array $nodes, string $glue = '') : string
     

    Pretty prints an array of nodes and implodes the printed values.

    • return string Imploded pretty printed nodes
    protected PhpParser\PrettyPrinterAbstract::pInfixOp(string $class, PhpParser\Node $leftNode, string $operatorString, PhpParser\Node $rightNode) : string
     

    Pretty-print an infix operation while taking precedence into account.

    • return string Pretty printed infix operation
    protected PhpParser\PrettyPrinterAbstract::pModifiers(int $modifiers)
     

    Print modifiers, including trailing whitespace.

    • return string Printed modifiers
    protected pName(PhpParser\Node\Name $node)
    protected pName_FullyQualified(PhpParser\Node\Name\FullyQualified $node)
    protected pName_Relative(PhpParser\Node\Name\Relative $node)
    protected pNullableType(PhpParser\Node\NullableType $node)
    protected pObjectProperty( $node)
    protected pParam(PhpParser\Node\Param $node)
    protected PhpParser\PrettyPrinterAbstract::pPostfixOp(string $class, PhpParser\Node $node, string $operatorString) : string
     

    Pretty-print a postfix operation while taking precedence into account.

    • return string Pretty printed postfix operation
    protected PhpParser\PrettyPrinterAbstract::pPrec(PhpParser\Node $node, int $parentPrecedence, int $parentAssociativity, int $childPosition) : string
     

    Prints an expression node with the least amount of parentheses necessary to preserve the meaning.

    • return string The pretty printed node
    protected PhpParser\PrettyPrinterAbstract::pPrefixOp(string $class, string $operatorString, PhpParser\Node $node) : string
     

    Pretty-print a prefix operation while taking precedence into account.

    • return string Pretty printed prefix operation
    protected PhpParser\PrettyPrinterAbstract::preprocessNodes(array $nodes)
     

    Preprocesses the top-level nodes to initialize pretty printer state.

      protected pScalar_DNumber(PhpParser\Node\Scalar\DNumber $node)
      protected pScalar_Encapsed(PhpParser\Node\Scalar\Encapsed $node)
      protected pScalar_EncapsedStringPart(PhpParser\Node\Scalar\EncapsedStringPart $node)
      protected pScalar_LNumber(PhpParser\Node\Scalar\LNumber $node)
      protected pScalar_MagicConst_Class(PhpParser\Node\Scalar\MagicConst\Class_ $node)
      protected pScalar_MagicConst_Dir(PhpParser\Node\Scalar\MagicConst\Dir $node)
      protected pScalar_MagicConst_File(PhpParser\Node\Scalar\MagicConst\File $node)
      protected pScalar_MagicConst_Function(PhpParser\Node\Scalar\MagicConst\Function_ $node)
      protected pScalar_MagicConst_Line(PhpParser\Node\Scalar\MagicConst\Line $node)
      protected pScalar_MagicConst_Method(PhpParser\Node\Scalar\MagicConst\Method $node)
      protected pScalar_MagicConst_Namespace(PhpParser\Node\Scalar\MagicConst\Namespace_ $node)
      protected pScalar_MagicConst_Trait(PhpParser\Node\Scalar\MagicConst\Trait_ $node)
      protected pScalar_String(PhpParser\Node\Scalar\String_ $node)
      protected pSingleQuotedString(string $string)
      protected pStmt_Break(PhpParser\Node\Stmt\Break_ $node)
      protected pStmt_Case(PhpParser\Node\Stmt\Case_ $node)
      protected pStmt_Catch(PhpParser\Node\Stmt\Catch_ $node)
      protected pStmt_Class(PhpParser\Node\Stmt\Class_ $node)
      protected pStmt_ClassConst(PhpParser\Node\Stmt\ClassConst $node)
      protected pStmt_ClassMethod(PhpParser\Node\Stmt\ClassMethod $node)
      protected pStmt_Const(PhpParser\Node\Stmt\Const_ $node)
      protected pStmt_Continue(PhpParser\Node\Stmt\Continue_ $node)
      protected pStmt_Declare(PhpParser\Node\Stmt\Declare_ $node)
      protected pStmt_DeclareDeclare(PhpParser\Node\Stmt\DeclareDeclare $node)
      protected pStmt_Do(PhpParser\Node\Stmt\Do_ $node)
      protected pStmt_Echo(PhpParser\Node\Stmt\Echo_ $node)
      protected pStmt_Else(PhpParser\Node\Stmt\Else_ $node)
      protected pStmt_ElseIf(PhpParser\Node\Stmt\ElseIf_ $node)
      protected pStmt_Expression(PhpParser\Node\Stmt\Expression $node)
      protected pStmt_Finally(PhpParser\Node\Stmt\Finally_ $node)
      protected pStmt_For(PhpParser\Node\Stmt\For_ $node)
      protected pStmt_Foreach(PhpParser\Node\Stmt\Foreach_ $node)
      protected pStmt_Function(PhpParser\Node\Stmt\Function_ $node)
      protected pStmt_Global(PhpParser\Node\Stmt\Global_ $node)
      protected pStmt_Goto(PhpParser\Node\Stmt\Goto_ $node)
      protected pStmt_GroupUse(PhpParser\Node\Stmt\GroupUse $node)
      protected pStmt_HaltCompiler(PhpParser\Node\Stmt\HaltCompiler $node)
      protected pStmt_If(PhpParser\Node\Stmt\If_ $node)
      protected pStmt_InlineHTML(PhpParser\Node\Stmt\InlineHTML $node)
      protected pStmt_Interface(PhpParser\Node\Stmt\Interface_ $node)
      protected pStmt_Label(PhpParser\Node\Stmt\Label $node)
      protected pStmt_Namespace(PhpParser\Node\Stmt\Namespace_ $node)
      protected pStmt_Nop(PhpParser\Node\Stmt\Nop $node)
      protected pStmt_Property(PhpParser\Node\Stmt\Property $node)
      protected pStmt_PropertyProperty(PhpParser\Node\Stmt\PropertyProperty $node)
      protected pStmt_Return(PhpParser\Node\Stmt\Return_ $node)
      protected pStmt_Static(PhpParser\Node\Stmt\Static_ $node)
      protected pStmt_StaticVar(PhpParser\Node\Stmt\StaticVar $node)
      protected pStmt_Switch(PhpParser\Node\Stmt\Switch_ $node)
      protected pStmt_Throw(PhpParser\Node\Stmt\Throw_ $node)
      protected pStmt_Trait(PhpParser\Node\Stmt\Trait_ $node)
      protected pStmt_TraitUse(PhpParser\Node\Stmt\TraitUse $node)
      protected pStmt_TraitUseAdaptation_Alias(PhpParser\Node\Stmt\TraitUseAdaptation\Alias $node)
      protected pStmt_TraitUseAdaptation_Precedence(PhpParser\Node\Stmt\TraitUseAdaptation\Precedence $node)
      protected pStmt_TryCatch(PhpParser\Node\Stmt\TryCatch $node)
      protected pStmt_Unset(PhpParser\Node\Stmt\Unset_ $node)
      protected pStmt_Use(PhpParser\Node\Stmt\Use_ $node)
      protected pStmt_UseUse(PhpParser\Node\Stmt\UseUse $node)
      protected pStmt_While(PhpParser\Node\Stmt\While_ $node)
      protected PhpParser\PrettyPrinterAbstract::pStmts(array $nodes, bool $indent = true) : string
       

      Pretty prints an array of nodes (statements) and indents them optionally.

      • return string Pretty printed statements
      protected pUnionType(PhpParser\Node\UnionType $node)
      protected pUseType( $type)
      protected pVarLikeIdentifier(PhpParser\Node\VarLikeIdentifier $node)
      protected PhpParser\PrettyPrinterAbstract::resetState()
       

      Reset pretty printing state.

      protected PhpParser\PrettyPrinterAbstract::safeAppend(string $str, string $append)
       

      Appends to a string, ensuring whitespace between label characters.

      Example: "echo" and "$x" result in "echo$x", but "echo" and "x" result in "echo x".
      Without safeAppend the result would be "echox", which does not preserve semantics.

        protected PhpParser\PrettyPrinterAbstract::setIndentLevel(int $level)
         

        Set indentation level

          Methods
          private hasNodeWithComments(array $nodes)
           
          • return bool
          private pMaybeMultiline(array $nodes, $trailingComma = false)
          © 2020 Bruce Wells
          Search Namespaces \ Classes
          ConfigurationNumbers (0-9.) only