Exemple #1
0
 /**
  * @param \ReflectionProperty $property
  * @return Property
  */
 public function property(\ReflectionProperty $property)
 {
     $phpyProperty = new Property($property->getName());
     $phpyProperty->setStatic($property->isStatic());
     $refClass = $property->getDeclaringClass();
     $defClassValues = $refClass->getDefaultProperties();
     if (isset($defClassValues[$property->getName()])) {
         $phpyProperty->setDefaultValue($defClassValues[$property->getName()]);
     }
     if ($property->isPublic()) {
         $phpyProperty->setVisibility('public');
     } elseif ($property->isProtected()) {
         $phpyProperty->setVisibility('protected');
     } else {
         $phpyProperty->setVisibility('private');
     }
     return $phpyProperty;
 }
Exemple #2
0
 public function testGetAndIsStatic()
 {
     $this->property->setStatic(true);
     $this->assertTrue($this->property->isStatic());
 }