Phan\Debug::printNode PHP Méthode

printNode() public static méthode

public static printNode ( string | ast\Node | null $node ) : null
$node string | ast\Node | null An AST node Print an AST node
Résultat null
    public static function printNode($node)
    {
        print self::nodeToString($node);
    }

Usage Example

Exemple #1
0
 /**
  * This first pass parses code and looks for the subset
  * of issues that can be found without having to have
  * an understanding of the entire code base.
  *
  * @param CodeBase $code_base
  * The CodeBase represents state across the entire
  * code base. This is a mutable object which is
  * populated as we parse files
  *
  * @param string $file_path
  * The full path to a file we'd like to parse
  *
  * @return Context
  */
 public static function parseFile(CodeBase $code_base, string $file_path) : Context
 {
     $context = (new Context())->withFile($file_path);
     // Convert the file to an Abstract Syntax Tree
     // before passing it on to the recursive version
     // of this method
     $node = \ast\parse_file($file_path, Config::get()->ast_version);
     if (Config::get()->dump_ast) {
         echo $file_path . "\n" . str_repeat("¯", strlen($file_path)) . "\n";
         Debug::printNode($node);
         return $context;
     }
     if (empty($node)) {
         Issue::emit(Issue::EmptyFile, $file_path, 0, $file_path);
         return $context;
     }
     return self::parseNodeInContext($code_base, $context, $node);
 }
All Usage Examples Of Phan\Debug::printNode