Example #1
0
 /**
  * @return string
  */
 public function compileTemplate()
 {
     return sprintf(include PHPFHIR_TEMPLATE_DIR . '/autoload_template.php', $this->outputNamespace, CopyrightUtils::getBasePHPFHIRCopyrightComment(), var_export($this->_classMap, true));
 }
Example #2
0
 /**
  * @param string $xsdPath
  * @param string $outputPath
  * @param string $outputNamespace
  */
 private static function _initializeClasses($xsdPath, $outputPath, $outputNamespace)
 {
     // Initialize some of our static classes
     CopyrightUtils::compileCopyrights($xsdPath);
     ClassGenerator::init($outputNamespace);
     // Create root NS dir
     FileUtils::createDirsFromNS($outputPath, $outputNamespace);
 }
Example #3
0
 /**
  * @inheritDoc
  */
 public function compileTemplate()
 {
     $this->addExtendedClassProperties();
     return sprintf(include PHPFHIR_TEMPLATE_DIR . '/parser_map_template.php', $this->outputNamespace, CopyrightUtils::getBasePHPFHIRCopyrightComment(), var_export($this->_bigDumbMap, true));
 }
 /**
  * @return string
  */
 public function compileTemplate()
 {
     return sprintf(include PHPFHIR_TEMPLATE_DIR . '/response_parser_template.php', $this->outputNamespace, CopyrightUtils::getBasePHPFHIRCopyrightComment());
 }
Example #5
0
 /**
  * @return string
  */
 public function compileTemplate()
 {
     $ns = $this->getNamespace();
     if ('' === $ns) {
         $output = "<?php\n\n";
     } else {
         $output = sprintf("<?php namespace %s;\n\n", $ns);
     }
     $output = sprintf("%s%s\n\n%s", $output, CopyrightUtils::getFullPHPFHIRCopyrightComment(), $this->_compileUseStatements());
     if ("\n\n" !== substr($output, -2)) {
         $output = sprintf("%s\n", $output);
     }
     if (isset($this->documentation) && count($this->documentation) > 0) {
         $output = sprintf("%s/**\n%s */\n", $output, $this->getDocBlockDocumentationFragment(1));
     }
     if ($this->_extendedElementMapEntry) {
         $output = sprintf('%sclass %s extends %s', $output, $this->getClassName(), $this->_extendedElementMapEntry->getClassName());
     } else {
         $output = sprintf('%sclass %s', $output, $this->getClassName());
     }
     if (count($this->_implementedInterfaces) > 0) {
         $interfaces = array();
         foreach ($this->_implementedInterfaces as $interface) {
             if (0 === strpos($interface, '\\') && 1 === substr_count($interface, '\\')) {
                 $interfaces[] = $interface;
             } else {
                 $interfaces[] = ltrim(substr($interface, strrpos($interface, '\\')), '\\');
             }
         }
         $output = sprintf('%s implements %s', $output, implode(', ', $interfaces));
     }
     $output = sprintf("%s\n{\n", $output);
     foreach ($this->getProperties() as $property) {
         $output = sprintf('%s%s', $output, (string) $property);
     }
     foreach ($this->getMethods() as $method) {
         $output = sprintf('%s%s', $output, (string) $method);
     }
     return sprintf("%s\n}", $output);
 }
 /**
  * @return string
  */
 public function compileTemplate()
 {
     return sprintf(include PHPFHIR_TEMPLATE_DIR . '/json_serializable_interface_template.php', $this->outputNamespace, CopyrightUtils::getBasePHPFHIRCopyrightComment());
 }