Class yii\apidoc\helpers\PrettyPrinter

Inheritanceyii\apidoc\helpers\PrettyPrinter » phpDocumentor\Reflection\PrettyPrinter
Available since extension's version2.0
Source Code https://github.com/yiisoft/yii2-apidoc/blob/master/helpers/PrettyPrinter.php

Enhances the phpDocumentor PrettyPrinter with short array syntax

Public Methods

Hide inherited methods

Method Description Defined By
getRepresentationOfValue() Returns a simple human readable output for a value. yii\apidoc\helpers\PrettyPrinter
pExpr_Array() yii\apidoc\helpers\PrettyPrinter

Method Details

Hide inherited methods

getRepresentationOfValue() public static method

Returns a simple human readable output for a value.

public static string getRepresentationOfValue ( \PhpParser\Node\Expr $value )
$value \PhpParser\Node\Expr

The value node as provided by PHP-Parser.

                public static function getRepresentationOfValue(Expr $value)
{
    if ($value === null) {
        return '';
    }
    $printer = new static();
    return $printer->prettyPrintExpr($value);
}

            
pExpr_Array() public method

public string pExpr_Array ( \PhpParser\Node\Expr\Array_ $node )
$node \PhpParser\Node\Expr\Array_

                public function pExpr_Array(Expr\Array_ $node)
{
    return '[' . $this->pCommaSeparated($node->items) . ']';
}