Documentation

Printer
in package

Inspired by https://github.com/nikic/PHP-Parser/tree/36a6dcd04e7b0285e8f0868f44bd4927802f7df1

Copyright (c) 2011, Nikita Popov All rights reserved.

Table of Contents

$differ  : Differ<string|int, Node>
$emptyListInsertionMap  : array<string, array{: string|null, : string, : string}>
[$find, $extraLeft, $extraRight]
$listInsertionMap  : array<string, string>
Map From "{$class}->{$subNode}" to string that should be inserted between elements of this list subnode
$parenthesesListMap  : array<string, array<int, class-string<\PHPStan\PhpDocParser\Ast\Type\TypeNode>>>
$parenthesesMap  : array<string, array<int, class-string<\PHPStan\PhpDocParser\Ast\Type\TypeNode>>>
print()  : string
printFormatPreserving()  : string
isMultiline()  : array{: bool, : string, : string}
printArrayFormatPreserving()  : string|null
printConstExpr()  : string
printNodeFormatPreserving()  : string
printOffsetAccessType()  : string
printTagValue()  : string
printType()  : string
wrapInParentheses()  : string

Properties

$emptyListInsertionMap

[$find, $extraLeft, $extraRight]

private array<string, array{: string|null, : string, : string}> $emptyListInsertionMap = [PHPStanPhpDocParserAstTypeCallableTypeNode::class . '->parameters' => ['(', '', ''], PHPStanPhpDocParserAstTypeArrayShapeNode::class . '->items' => ['{', '', ''], PHPStanPhpDocParserAstTypeObjectShapeNode::class . '->items' => ['{', '', ''], PHPStanPhpDocParserAstPhpDocDoctrineDoctrineArray::class . '->items' => ['{', '', ''], PHPStanPhpDocParserAstPhpDocDoctrineDoctrineAnnotation::class . '->arguments' => ['(', '', '']]

$listInsertionMap

Map From "{$class}->{$subNode}" to string that should be inserted between elements of this list subnode

private array<string, string> $listInsertionMap = [PHPStanPhpDocParserAstPhpDocPhpDocNode::class . '->children' => " * ", PHPStanPhpDocParserAstTypeUnionTypeNode::class . '->types' => '|', PHPStanPhpDocParserAstTypeIntersectionTypeNode::class . '->types' => '&', PHPStanPhpDocParserAstTypeArrayShapeNode::class . '->items' => ', ', PHPStanPhpDocParserAstTypeObjectShapeNode::class . '->items' => ', ', PHPStanPhpDocParserAstTypeCallableTypeNode::class . '->parameters' => ', ', PHPStanPhpDocParserAstTypeCallableTypeNode::class . '->templateTypes' => ', ', PHPStanPhpDocParserAstTypeGenericTypeNode::class . '->genericTypes' => ', ', PHPStanPhpDocParserAstConstExprConstExprArrayNode::class . '->items' => ', ', PHPStanPhpDocParserAstPhpDocMethodTagValueNode::class . '->parameters' => ', ', PHPStanPhpDocParserAstPhpDocDoctrineDoctrineArray::class . '->items' => ', ', PHPStanPhpDocParserAstPhpDocDoctrineDoctrineAnnotation::class . '->arguments' => ', ']

$parenthesesListMap

private array<string, array<int, class-string<\PHPStan\PhpDocParser\Ast\Type\TypeNode>>> $parenthesesListMap = [PHPStanPhpDocParserAstTypeIntersectionTypeNode::class . '->types' => [PHPStanPhpDocParserAstTypeIntersectionTypeNode::class, PHPStanPhpDocParserAstTypeUnionTypeNode::class, PHPStanPhpDocParserAstTypeNullableTypeNode::class], PHPStanPhpDocParserAstTypeUnionTypeNode::class . '->types' => [PHPStanPhpDocParserAstTypeIntersectionTypeNode::class, PHPStanPhpDocParserAstTypeUnionTypeNode::class, PHPStanPhpDocParserAstTypeNullableTypeNode::class]]

$parenthesesMap

private array<string, array<int, class-string<\PHPStan\PhpDocParser\Ast\Type\TypeNode>>> $parenthesesMap = [PHPStanPhpDocParserAstTypeCallableTypeNode::class . '->returnType' => [PHPStanPhpDocParserAstTypeCallableTypeNode::class, PHPStanPhpDocParserAstTypeUnionTypeNode::class, PHPStanPhpDocParserAstTypeIntersectionTypeNode::class], PHPStanPhpDocParserAstTypeArrayTypeNode::class . '->type' => [PHPStanPhpDocParserAstTypeCallableTypeNode::class, PHPStanPhpDocParserAstTypeUnionTypeNode::class, PHPStanPhpDocParserAstTypeIntersectionTypeNode::class, PHPStanPhpDocParserAstTypeConstTypeNode::class, PHPStanPhpDocParserAstTypeNullableTypeNode::class], PHPStanPhpDocParserAstTypeOffsetAccessTypeNode::class . '->type' => [PHPStanPhpDocParserAstTypeCallableTypeNode::class, PHPStanPhpDocParserAstTypeUnionTypeNode::class, PHPStanPhpDocParserAstTypeIntersectionTypeNode::class, PHPStanPhpDocParserAstTypeConstTypeNode::class, PHPStanPhpDocParserAstTypeNullableTypeNode::class]]

Methods

print()

public print(Node $node) : string
Parameters
$node : Node
Return values
string

isMultiline()

private isMultiline(int $initialIndex, array<string|int, Node$nodes, TokenIterator $originalTokens) : array{: bool, : string, : string}
Parameters
$initialIndex : int
$nodes : array<string|int, Node>
$originalTokens : TokenIterator
Return values
array{: bool, : string, : string}

printArrayFormatPreserving()

private printArrayFormatPreserving(array<string|int, Node$nodes, array<string|int, Node$originalNodes, TokenIterator $originalTokens, int &$tokenIndex, string $parentNodeClass, string $subNodeName) : string|null
Parameters
$nodes : array<string|int, Node>
$originalNodes : array<string|int, Node>
$originalTokens : TokenIterator
$tokenIndex : int
$parentNodeClass : string
$subNodeName : string
Return values
string|null

printOffsetAccessType()

private printOffsetAccessType(TypeNode $type) : string
Parameters
$type : TypeNode
Return values
string

wrapInParentheses()

private wrapInParentheses(TypeNode $node) : string
Parameters
$node : TypeNode
Return values
string

Search results