function __construct(ReflectionProperty $property) { $this->name = $property->getName(); $this->is_public = $property->isPublic(); $this->is_private = $property->isPrivate(); $this->is_protected = $property->isProtected(); $this->is_static = $property->isStatic(); $this->declaring_class = API_Doc_Class::instance($property->getDeclaringClass()); list($comment, $meta) = $this->_docComment($property->getDocComment()); $this->_processDescription($comment); $this->_processMeta($meta); }
protected function _findPackages($files) { $found_classes = array(); foreach ($files as $file) { require_once $file; } $classes = array_merge(get_declared_classes(), get_declared_interfaces()); $this->_last_errors = array(); foreach ($classes as $class) { $doc = new ReflectionClass($class); if (!in_array($doc->getFileName(), $files)) { continue; } try { $found_classes[] = API_Doc_Class::instance($class); } catch (API_Doc_Exception $ex) { $this->_last_errors[] = $ex; } } foreach ($found_classes as $class) { try { $package = $class->package; if (!$package) { throw new API_Doc_EmptyPackageException($class, sprintf('Class "%s" use empty package name.', $class->name)); } $package->classes[] = $class; if (!isset($this->packages[$package->name])) { $this->packages[$package->name] = $package; } } catch (API_Doc_Exception $ex) { $this->_last_errors[] = $ex; } } $this->classes = $found_classes; foreach ($this->packages as $name => $package) { $filename = "{$this->docs_dir}/package.{$name}.texy"; if (is_file($filename)) { $contents = file_get_contents($filename); $lines = explode("\n", $contents); $summary = reset($lines); $package->summary = trim($summary); $package->description = $contents; unset($lines); } } }
private function _processing() { $this->methods = array(); $class = $this->_reflection_class; foreach ($class->getMethods() as $method_r) { $method = new API_Doc_Method($method_r); $method->is_inherited = $method_r->getDeclaringClass() != $class; if (!$method->is_inherited) { $this->native_methods_count++; } $this->methods[] = $method; } $this->properties = array(); foreach ($class->getProperties() as $property_r) { $property = new API_Doc_Property($property_r); $property->is_inherited = $property_r->getDeclaringClass() != $class; if (!$property->is_inherited) { $this->native_properties_count++; } $this->properties[] = $property; } $this->constants = array(); foreach ($class->getConstants() as $name => $value) { $this->constants[] = new API_Doc_Constant($this, $name, $value); } foreach ($class->getInterfaces() as $interface) { $this->interfaces[] = new API_Doc_Class($interface); } list($comment, $meta) = $this->_docComment($class->getDocComment()); $this->_processDescription($comment); $this->_processMeta($meta); $parent = $class->getParentClass(); if ($parent) { $this->parent = API_Doc_Class::instance($parent); } }