/** * @param string $outputPath * @param string $outputNamespace * @param string $class */ public function __construct($outputPath, $outputNamespace, $class) { $this->outputPath = rtrim($outputPath, "\\/"); $this->outputNamespace = $outputNamespace; if (NameUtils::isValidClassName($class)) { $this->class = $class; } else { throw new \RuntimeException(sprintf('%s::__construct - Specified invalid class name %s.', get_called_class(), $class)); } $this->classPath = sprintf('%s/%s/%s.php', $this->outputPath, FileUtils::buildDirPathFromNS($this->outputNamespace), $class); $this->className = sprintf('%s\\%s', $this->outputNamespace, $class); }
/** * Constructor * * @param string $fhirElementName * @param string $className * @param string $namespace * @param ComplexClassTypesEnum $classType */ public function __construct($fhirElementName, $className, $namespace, ComplexClassTypesEnum $classType = null) { if (NameUtils::isValidClassName($className)) { $this->_className = $className; } else { throw new \InvalidArgumentException('Class Name "' . $className . '" is not valid.'); } if (NameUtils::isValidNSName($namespace)) { $this->_namespace = $namespace; } else { throw new \InvalidArgumentException('Namespace "' . $namespace . '" is not valid.'); } $this->_elementName = $fhirElementName; $this->_classType = $classType; }