/** * Return a PHP_UML object to test * * @return PHP_UML */ static function getPhpUmlObject() { PHP_UML_SimpleUID::$deterministic = true; PHP_UML_SimpleUID::reset(); $uml = new PHP_UML(); $uml->setIgnorePatterns(self::$IGNORED_DIR); $uml->docblocks = true; $uml->dollar = false; $uml->componentView = false; $uml->deploymentView = true; $uml->pureObject = false; return $uml; }
/** * Initialize the structure before use (we just instantiate the top objects in * the logical and deployment models) * * @param string $modelName Model name */ public function initModel($modelName = 'default') { $this->packages = new PHP_UML_Metamodel_Package(); $this->packages->name = $modelName; $this->packages->id = PHP_UML_SimpleUID::getUID(); $this->addInternalPhpTypes(); $this->deploymentPackages = new PHP_UML_Metamodel_Package(); $this->deploymentPackages->name = 'Deployment View'; $this->deploymentPackages->id = PHP_UML_SimpleUID::getUID(); }
/** * Generates an ID for an element. A partial identifier can be provided * (used for classes and their idrefs) * * @param string $prefix Prefix * * @return string ID */ protected static function getUID($prefix = null) { if (is_null($prefix)) { return PHP_UML_SimpleUID::getUID(); } else { return md5(self::EXPORTER_NAME . '#' . $prefix); } }
/** * Reset the deterministic generator * */ static function reset() { self::$counter = 0; }
/** * Returns a unique ID * * @return string */ private static function getUID() { return PHP_UML_SimpleUID::getUID(); }