PHPSA\Definition\RuntimeClassDefinition::hasProperty PHP 메소드

hasProperty() 공개 메소드

public hasProperty ( $name, boolean $inherit = false ) : boolean
$name
$inherit boolean
리턴 boolean
    public function hasProperty($name, $inherit = false)
    {
        return $this->reflection->hasProperty($name);
    }

Usage Example

예제 #1
0
 public function testHasProperty()
 {
     $reflection = new ReflectionClass('PHPSA\\Context');
     $definition = new RuntimeClassDefinition($reflection);
     foreach ($reflection->getProperties() as $property) {
         static::assertTrue($definition->hasProperty($property->getName()));
     }
     static::assertFalse($definition->hasProperty('XXXXX'));
 }