/** * Returns class properties. * * @param integer $filter Properties filter * @return array */ public function getProperties($filter = null) { if (null === $this->properties) { $broker = $this->broker; $this->properties = array_map(function (InternalReflectionProperty $property) use($broker) { return ReflectionProperty::create($property, $broker); }, parent::getProperties()); } if (null === $filter) { return $this->properties; } return array_filter($this->properties, function (ReflectionProperty $property) use($filter) { return (bool) ($property->getModifiers() & $filter); }); }
/** * Tests an exception thrown when trying to create the reflection from a PHP internal reflection. * * @expectedException \TokenReflection\Exception\RuntimeException */ public function testInternalPropertyReflectionCreate() { Php\ReflectionProperty::create(new \ReflectionClass('Exception'), $this->getBroker()); }