Exemple #1
0
 protected function reflectAccess(Reflector $ref, SimpleXMLElement $element)
 {
     if ($ref->isPublic()) {
         $element['access'] = 'public';
     } elseif ($ref->isProtected()) {
         $element['access'] = 'protected';
     } elseif ($ref->isPrivate()) {
         $element['access'] = 'private';
     }
 }
Exemple #2
0
 protected function _getDefaultValue(Reflector $prop)
 {
     if ($prop->isProtected() && method_exists($prop, 'setAccesible')) {
         $prop->setAccessible(true);
     } else {
         if ($prop->isProtected()) {
             return '[UNKNOWN DEFAULT VALUE] (upgrade to PHP 5.3+ to reflect into protected properties)';
         }
     }
     if ($prop->isStatic()) {
         return $prop->getValue();
     }
     if (!$prop->getDeclaringClass()->isAbstract()) {
         $className = $prop->getDeclaringClass()->getName();
         $class = new $className();
         return $prop->getValue($class);
     }
     return null;
 }