PHPSA\Definition\RuntimeClassDefinition::hasProperty PHP Method

hasProperty() public method

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

Usage Example

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'));
 }