/** * @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] = []; $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) { $tagValues = $this->reflectPropertyTag($className, $property, $tagName, $tagValues); if ($tagValues === null) { continue; } $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; }
/** * @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; }