for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of NACL.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* @copyright 2019 Nuglif (2018) Inc.
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @author Pierrick Charron <[email protected]>
* @author Charle Demers <[email protected]>
*/
namespace Nuglif\Nacl;
class Nacl
{
private static $macros = [];
public static function registerMacro(MacroInterface $macro)
self::$macros[] = $macro;
}
public static function createParser()
$parser = new Parser;
$parser->registerMacro(new Macros\Env);
$parser->registerMacro(new Macros\Constant);
foreach (self::$macros as $macro) {
$parser->registerMacro($macro);
return $parser;
public static function parse($str)
return self::createParser()->parse($str);
public static function parseFile($file)
return self::createParser()->parseFile($file);
public static function dump($var)
return (new Dumper(
Dumper::PRETTY_PRINT | Dumper::SHORT_SINGLE_ELEMENT
))->dump($var);