Exemplo n.º 1
0
 /**
  * Sets the nesting package of an isolated attribute (the PHP "const")
  *
  * @param PHP_UML_Metamodel_Property &$a         A property
  * @param PHP_UML_Metamodel_Package  $nestingPkg The enclosing package
  */
 private function setNestingPackageOfAttribute(PHP_UML_Metamodel_Property &$a, PHP_UML_Metamodel_Package $nestingPkg)
 {
     $a->package = $nestingPkg;
     if (PHP_UML_Metamodel_Helper::searchAttributeIntoPackage($a->package, $a->name) === false) {
         $nestingPkg->ownedAttribute[] =& $a;
         $this->file->manifested[] =& $a;
     } else {
         PHP_UML_Warning::add('Constant ' . $a->name . ' already defined, in ' . $this->file->name);
     }
 }
Exemplo n.º 2
0
 /**
  * Resolution error. Might later be isolated in a specific class.
  * 
  * @param string                         $element Element
  * @param PHP_UML_Metamodel_NamedElement $na      NamedElement
  */
 protected static function resolutionWarning($element, $na)
 {
     PHP_UML_Warning::add('Could not resolve ' . $element . (empty($na->file) ? '' : ' in ' . $na->file->name));
 }
Exemplo n.º 3
0
 /**
  * Makes the type resolution for a given element in a given package
  *
  * @param PHP_UML_Metamodel_Package &$pkg     The nesting package
  * @param string                    &$element The element to resolve, provided as a name
  * @param PHP_UML_Metamodel_Package &$_pkgDef The root package
  * @param PHP_UML_Metamodel_Type    &$context The context (the nesting class/interface, which 
  *                                            is the only element to know the nesting file)
  */
 private function _resolveType(PHP_UML_Metamodel_Package &$pkg, &$element, PHP_UML_Metamodel_Package &$_pkgDef, PHP_UML_Metamodel_Type &$context)
 {
     $_o = $this->_searchIntoPackage($pkg, $element);
     if (!($_o === false)) {
         $element = $_o;
     } else {
         $_o = $this->_searchIntoPackage($_pkgDef, $element);
         if (!($_o === false)) {
             $element = $_o;
         } else {
             $_o = $this->_searchIntoDatatype($element);
             if (!($_o === false)) {
                 $element = $_o;
             } else {
                 PHP_UML_Warning::add('Could not resolve ' . $element . ' in ' . $context->file->name);
                 $element = null;
             }
         }
     }
 }