Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
WebIDL | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
parse | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace Wikimedia\WebIDL; |
4 | |
5 | /** |
6 | * WebIDL (https://github.com/wikimedia/WebIDL) |
7 | * Copyright (c) 2021, C. Scott Ananian. (MIT licensed) |
8 | * |
9 | * PHP library loosely inspired by |
10 | * https://github.com/w3c/webidl2.js |
11 | */ |
12 | class WebIDL { |
13 | /** |
14 | * Return an AST corresponding to the WebIDL input string. |
15 | * @param string $webidl The WebIDL input string to parse. |
16 | * @param array $options Optional parser options |
17 | * @return array The Abstract Syntax Tree |
18 | */ |
19 | public static function parse( string $webidl, array $options = [] ): array { |
20 | return Grammar::load( $webidl, $options ); |
21 | } |
22 | } |