Пример #1
0
 /**
  * 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;
 }
Пример #2
0
 /**
  * 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();
 }
Пример #3
0
 /**
  * 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);
     }
 }
Пример #4
0
 /**
  * Reset the deterministic generator
  *
  */
 static function reset()
 {
     self::$counter = 0;
 }
Пример #5
0
 /**
  * Returns a unique ID
  * 
  * @return string
  */
 private static function getUID()
 {
     return PHP_UML_SimpleUID::getUID();
 }