CodeGen
CodeGen copied to clipboard
Transform your dynamic calls to static calls!
new BoolExp(array $args, $operateor) shold produce $arg1 $operateor $arg2 operateor $argN
new ConcatExp(array $args) should produce $arg1 . $arg2 .$argN
``` php new ArrayAccessExpr('$var', [ 'foo', 'bar' ]); ``` generates: ``` php $var['foo']['bar']; ``` The access keys can be Expression objects: ``` php new ArrayAccessExpr('$var', [ 'foo', $someOtherExpr, $mathExpr ]);...
``` php $expr = new SafeArrayAccessExpr('$var', [ 'foo', 'bar' ]); ``` generates: ``` php isset($var['foo']['bar']) : $var['foo']['bar'] : null; ```