/** * * @param string $destinationDir * @param assoc array $params : the params composed the namespace and name of the class * @param array(of String) $data : list of controllers file names. * @todo Validate the data $params and $data */ public function __construct(Application $app, $params, $data) { parent::__construct($app); $this->destinationDir = array_key_exists(BaseClassGenerator::DestinationDirKey, $params) ? "APP_ROOT_DIR" . $params[BaseClassGenerator::DestinationDirKey] : ""; $this->placeholders = \Puzzlout\Framework\GeneratorEngine\Placeholders\PlaceholdersManager::InitPlaceholdersForPhpDoc($params); $this->data = $data; $templateHeader = TemplateFileNameConstants::GetFullNameForConst(TemplateFileNameConstants::ClassTemplate); $this->classTemplateContents = file_exists($templateHeader) ? file_get_contents($templateHeader) : false; }
public function __construct(Application $app, $params, $data) { parent::__construct($app, $params, $data); if (!$this->app->UnitTestingEnabled) { $this->fileName = array_key_exists(self::CultureKey, $params) ? $params[self::ClassNameKey] . "_" . $params[self::CultureKey] . ".php" : $params[self::ClassNameKey] . ".php"; $this->className = !is_null($params[self::ClassDerivation]) ? str_replace(".php", "", $this->fileName) . " extends " . $params[self::ClassDerivation] : str_replace(".php", "", $this->fileName); $params[self::ClassNameKey] = $this->className; $this->placeholders = \Puzzlout\Framework\GeneratorEngine\Placeholders\PlaceholdersManager::InitPlaceholdersForPhpDoc($params); $this->DoGenerateConstantKeys = array_key_exists(ConstantsClassGeneratorBase::DoGenerateConstantKeysKey, $params) ? $params[ConstantsClassGeneratorBase::DoGenerateConstantKeysKey] : false; $this->DoGenerateGetListMethod = array_key_exists(ConstantsClassGeneratorBase::DoGenerateGetListMethodKey, $params) ? $params[ConstantsClassGeneratorBase::DoGenerateGetListMethodKey] : false; } }