/** * Available options: * * noLocation: boolean, * (By default, the parser creates AST nodes that know the location * in the source that they correspond to. This configuration flag * disables that behavior for performance or testing.) * * noSource: boolean, * By default, the parser creates AST nodes that contain a reference * to the source that they were created from. This configuration flag * disables that behavior for performance or testing. * * @param Source|string $source * @param array $options * @return Document */ public static function parse($source, array $options = array()) { $sourceObj = $source instanceof Source ? $source : new Source($source); $parser = new self($sourceObj, $options); return $parser->parseDocument(); }