public function afterCompile(ClassType $class) { $init = $class->getMethods()['initialize']; $init->addBody(__CLASS__ . '::registerControls();'); }