/**
  * Initializes a new file descriptor with the given hash of its contents.
  *
  * @param string $hash An MD5 hash of the contents if this file.
  */
 public function __construct($hash)
 {
     parent::__construct();
     $this->setHash($hash);
     $this->setNamespaceAliases(new Collection());
     $this->setIncludes(new Collection());
     $this->setConstants(new Collection());
     $this->setFunctions(new Collection());
     $this->setClasses(new Collection());
     $this->setInterfaces(new Collection());
     $this->setTraits(new Collection());
     $this->setMarkers(new Collection());
 }
 /**
  * Initializes the all properties representing a collection with a new Collection object.
  */
 public function __construct()
 {
     parent::__construct();
     $this->setArguments(new Collection());
 }
 /**
  * @param string $package
  */
 public function setPackage($package)
 {
     parent::setPackage($package);
     foreach ($this->getConstants() as $constant) {
         // TODO #840: Workaround; for some reason there are NULLs in the constants array.
         if ($constant) {
             $constant->setPackage($package);
         }
     }
     foreach ($this->getProperties() as $property) {
         // TODO #840: Workaround; for some reason there are NULLs in the properties array.
         if ($property) {
             $property->setPackage($package);
         }
     }
     foreach ($this->getMethods() as $method) {
         // TODO #840: Workaround; for some reason there are NULLs in the methods array.
         if ($method) {
             $method->setPackage($package);
         }
     }
 }
 public function setPackage($package)
 {
     parent::setPackage($package);
     foreach ($this->getConstants() as $constant) {
         $constant->setPackage($package);
     }
     foreach ($this->getMethods() as $method) {
         $method->setPackage($package);
     }
 }
 public function setPackage($package)
 {
     parent::setPackage($package);
     foreach ($this->getProperties() as $property) {
         $property->setPackage($package);
     }
     foreach ($this->getMethods() as $method) {
         $method->setPackage($package);
     }
 }
 /**
  * Checks whether the given element is a class and if its parent could not be resolved; increment the counter.
  *
  * @param DescriptorAbstract $element
  */
 protected function incrementUnresolvedParentCounter($element)
 {
     if (!$element instanceof ClassDescriptor) {
         return;
     }
     if (is_string($element->getParent())) {
         $this->unresolvedParentClassesCount++;
     }
 }