/** * @param StructModel $struct * @return StructEnumFile|StructArrayFile|StructFile */ private function getStructFile(StructModel $struct) { if ($struct->getisRestriction()) { $file = new StructEnumFile($this->generator, $struct->getPackagedName()); } elseif ($struct->isArray()) { $file = new StructArrayFile($this->generator, $struct->getPackagedName()); } else { $file = new StructFile($this->generator, $struct->getPackagedName()); } return $file; }
/** * work around for https://bugs.php.net/bug.php?id=69280 * @param StructModel $struct * @return ClassMap */ protected function getStructName(StructModel $struct) { return substr($struct->getPackagedName(true), $struct->getNamespace() != '' ? 1 : 0); }