/** * getCodeGenerator() * * @return \Zend\CodeGenerator\Php\PhpClass */ public function getCodeGenerator() { $codeGenFile = Php\PhpFile::fromReflectedFileName($this->getPath()); $codeGenFileClasses = $codeGenFile->getClasses(); $class = array_shift($codeGenFileClasses); return $class; }
/** * hasActionMethod() * * @param string $controllerPath * @param string $actionName * @return bool */ public static function hasActionMethod($controllerPath, $actionName) { if (!file_exists($controllerPath)) { return false; } $controllerCodeGenFile = Php\PhpFile::fromReflectedFileName($controllerPath, true, true); return $controllerCodeGenFile->getClass()->hasMethod($actionName . 'Action'); }