I think each `$func` case can be moved to their own methods and can be called using variable methods like `$this->{"compile".ucfirst($func)}(params...)` so the cyclomatic and npath complexity will be decreased.