Exemple #1
0
 /**
  * Populate the entry with information about the class
  */
 public function finalise()
 {
     $ref = new \ReflectionClass($this->class);
     $classComment = $ref->getDocComment();
     $this->exportAll = preg_match('/@ExportAll\\s/', $classComment) > 0;
     $parent = $ref->getParentClass();
     if ($parent && $this->manifest->containsClass($parent->getName())) {
         $this->extends = $this->manifest->getEntryByClass($parent->getName())->alias;
     }
     $this->finaliseMethods();
     $this->finaliseProperties();
     $this->finaliseConstants();
     $this->finaliseTraits();
 }
Exemple #2
0
 private function generateObjectId($object)
 {
     $entry = $this->manifest->getEntryByClass(get_class($object));
     if (!$entry) {
         throw new \RuntimeException('Class not in manifest');
     }
     if (!count($entry->identifiers)) {
         return;
     }
     $ids = array();
     foreach ($entry->identifiers as $prop) {
         $val = $object->{$prop};
         if ($val != null) {
             $ids[] = sprintf('%s=%s', $prop, $val);
         }
     }
     if (count($ids)) {
         $src = 'SERVER:' . get_class($object) . ':' . join(',', $ids);
         $generatedId = md5($src);
         return $generatedId;
     }
 }