[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/phpast/controller/ -> PhabricatorXHPASTViewStreamController.php (source)

   1  <?php
   2  
   3  final class PhabricatorXHPASTViewStreamController
   4    extends PhabricatorXHPASTViewPanelController {
   5  
   6    public function processRequest() {
   7      $storage = $this->getStorageTree();
   8      $input = $storage->getInput();
   9      $stdout = $storage->getStdout();
  10  
  11      $tree = XHPASTTree::newFromDataAndResolvedExecFuture(
  12        $input,
  13        array(0, $stdout, ''));
  14  
  15      $tokens = array();
  16      foreach ($tree->getRawTokenStream() as $id => $token) {
  17        $seq = $id;
  18        $name = $token->getTypeName();
  19        $title = "Token {$seq}: {$name}";
  20  
  21        $tokens[] = phutil_tag(
  22          'span',
  23          array(
  24            'title' => $title,
  25            'class' => 'token',
  26          ),
  27          $token->getValue());
  28      }
  29  
  30      return $this->buildXHPASTViewPanelResponse(
  31        phutil_implode_html('', $tokens));
  32    }
  33  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1