/** * @covers phpDocumentor\Descriptor\PropertyDescriptor::getTypes * @covers phpDocumentor\Descriptor\PropertyDescriptor::setTypes */ public function testSetAndGetTypes() { $this->assertSame(array(), $this->fixture->getTypes()); $this->fixture->setTypes(array(1)); $this->assertSame(array(1), $this->fixture->getTypes()); }
/** * @return Collection */ public function getMagicProperties() { /** @var Collection $propertyTags */ $propertyTags = clone $this->getTags()->get('property', new Collection()); $propertyTags = $propertyTags->merge($this->getTags()->get('property-read', new Collection())); $propertyTags = $propertyTags->merge($this->getTags()->get('property-write', new Collection())); $properties = new Collection(); /** @var Tag\PropertyDescriptor $propertyTag */ foreach ($propertyTags as $propertyTag) { $property = new PropertyDescriptor(); $property->setName(ltrim($propertyTag->getVariableName(), '$')); $property->setDescription($propertyTag->getDescription()); $property->setTypes($propertyTag->getTypes()); $property->setParent($this); $properties->add($property); } if ($this->getParent() instanceof ClassDescriptor) { $properties = $properties->merge($this->getParent()->getMagicProperties()); } return $properties; }