| Total Complexity | 6 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Coverage | 78.95% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | class Nacl |
||
| 17 | { |
||
| 18 | private static $macros = []; |
||
| 19 | |||
| 20 | 1 | public static function registerMacro(MacroInterface $macro) |
|
| 23 | 1 | } |
|
| 24 | |||
| 25 | 577 | public static function createParser() |
|
| 26 | { |
||
| 27 | 577 | $parser = new Parser; |
|
| 28 | 577 | $parser->registerMacro(new Macros\Env); |
|
| 29 | 577 | $parser->registerMacro(new Macros\Constant); |
|
| 30 | |||
| 31 | 577 | foreach (self::$macros as $macro) { |
|
| 32 | 5 | $parser->registerMacro($macro); |
|
| 33 | 577 | } |
|
| 34 | |||
| 35 | 577 | return $parser; |
|
| 36 | } |
||
| 37 | |||
| 38 | 538 | public static function parse($str) |
|
| 39 | { |
||
| 40 | 538 | return self::createParser()->parse($str); |
|
| 41 | } |
||
| 42 | |||
| 43 | 9 | public static function parseFile($file) |
|
| 44 | { |
||
| 45 | 9 | return self::createParser()->parseFile($file); |
|
| 46 | } |
||
| 47 | |||
| 48 | public static function dump($var) |
||
| 53 | } |
||
| 54 | } |
||
| 55 |