Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 96e5264f05
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (28 sloc) 0.728 kb
<?php
/**
* @group conduit
*/
final class ConduitAPI_phpast_getast_Method extends ConduitAPIMethod {
public function getMethodDescription() {
return "Parse a piece of PHP code.";
}
public function defineParamTypes() {
return array(
'code' => 'required string',
);
}
public function defineReturnType() {
return 'nonempty dict';
}
public function defineErrorTypes() {
return array(
'ERR-XHPAST-LEY' => 'xhpast got Rickrolled',
);
}
protected function execute(ConduitAPIRequest $request) {
$source = $request->getValue('code');
$future = xhpast_get_parser_future($source);
list($stdout) = $future->resolvex();
return json_decode($stdout, true);
}
}
Jump to Line
Something went wrong with that request. Please try again.