Permalink
Browse files

Fix #915 issue, fetch properties for Runtime Class Definition

  • Loading branch information...
ovr committed Apr 25, 2015
1 parent 416c989 commit d6aa9772382f926073f7f7b5a0f989fc14e35310
Showing with 83 additions and 3 deletions.
  1. +33 −0 Library/ClassDefinition.php
  2. +32 −1 ext/test/exception.zep.c
  3. +10 −0 ext/test/exception.zep.h
  4. +8 −2 test/exception.zep
@@ -1553,6 +1553,39 @@ public static function buildFromReflection(\ReflectionClass $class)
}
}
$properties = $class->getProperties();
if (count($properties) > 0) {
foreach ($properties as $property) {
$visibility = array();
if ($property->isPublic()) {
$visibility[] = 'public';
}
if ($property->isPrivate()) {
$visibility[] = 'private';
}
if ($property->isProtected()) {
$visibility[] = 'protected';
}
if ($property->isStatic()) {
$visibility[] = 'static';
}
$classConstant = new ClassProperty(
$classDefinition,
$visibility,
$property->getName(),
null,
null,
null
);
$classDefinition->addProperty($classConstant);
}
}
$classDefinition->setIsInternal(true);
return $classDefinition;

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -6,5 +6,11 @@ namespace Test;
*/
class Exception extends \Exception
{
}
/**
* @link https://github.com/phalcon/zephir/issues/915
*/
public function testRuntimePropertyFetch(string! message)
{
let this->message = message;
}
}

0 comments on commit d6aa977

Please sign in to comment.