public function addMacro($macro)
{
$builder = $this->getContainerBuilder();
$definition = $builder->getDefinition($this->prefix('latteFactory'));
if (isset($macro[0]) && $macro[0] === '@') {
if (strpos($macro, '::') === FALSE) {
$method = 'install';
} else {
list($macro, $method) = explode('::', $macro);
}
$definition->addSetup('?->onCompile[] = function ($engine) { ?->' . $method . '($engine->getCompiler()); }', ['@self', $macro]);
} else {
if (strpos($macro, '::') === FALSE && class_exists($macro)) {
$macro .= '::install';
}
$definition->addSetup('?->onCompile[] = function ($engine) { ' . $macro . '($engine->getCompiler()); }', ['@self']);
}
}