/** * @param string $className * @param PropertyReflection $property * @param string $tagName * @param array $tagValues * @return array */ protected function reflectPropertyTag($className, PropertyReflection $property, $tagName, $tagValues) { if ($this->isTagIgnored($tagName)) { return null; } if ($tagName !== 'var' || !isset($tagValues[0])) { return $tagValues; } $propertyName = $property->getName(); $propertyDeclaringClass = $property->getDeclaringClass(); if ($propertyDeclaringClass->getName() !== $className && isset($this->classReflectionData[$propertyDeclaringClass->getName()][self::DATA_CLASS_PROPERTIES][$propertyName][self::DATA_PROPERTY_TAGS_VALUES][$tagName])) { $tagValues = $this->classReflectionData[$propertyDeclaringClass->getName()][self::DATA_CLASS_PROPERTIES][$propertyName][self::DATA_PROPERTY_TAGS_VALUES][$tagName]; } else { $tagValues[0] = $this->expandType($propertyDeclaringClass, $tagValues[0]); } return $tagValues; }
/** * @param string $className * @param PropertyReflection $property * @return integer visibility */ public function reflectClassProperty($className, PropertyReflection $property) { $propertyName = $property->getName(); $this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES][$propertyName] = array(); $visibility = $property->isPublic() ? self::VISIBILITY_PUBLIC : ($property->isProtected() ? self::VISIBILITY_PROTECTED : self::VISIBILITY_PRIVATE); $this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES][$propertyName][self::DATA_PROPERTY_VISIBILITY] = $visibility; foreach ($property->getTagsValues() as $tagName => $tagValues) { if ($this->isTagIgnored($tagName)) { continue; } if ($tagName === 'var' && isset($tagValues[0])) { if ($property->getDeclaringClass()->getName() !== $className && isset($this->classReflectionData[$property->getDeclaringClass()->getName()][self::DATA_CLASS_PROPERTIES][$propertyName][self::DATA_PROPERTY_TAGS_VALUES][$tagName])) { $tagValues = $this->classReflectionData[$property->getDeclaringClass()->getName()][self::DATA_CLASS_PROPERTIES][$propertyName][self::DATA_PROPERTY_TAGS_VALUES][$tagName]; } else { $tagValues[0] = $this->expandType($property->getDeclaringClass(), $tagValues[0]); } } $this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES][$propertyName][self::DATA_PROPERTY_TAGS_VALUES][$tagName] = $tagValues; } foreach ($this->annotationReader->getPropertyAnnotations($property, $propertyName) as $annotation) { $this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES][$propertyName][self::DATA_PROPERTY_ANNOTATIONS][get_class($annotation)][] = $annotation; } return $visibility; }