Skip to content

Commit d298796

Browse files
committed
ClassType::from() compatible with HHVM
1 parent 53d1bdb commit d298796

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PhpGenerator/ClassType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public static function from($from)
7070
$from = $from instanceof \ReflectionClass ? $from : new \ReflectionClass($from);
7171
$class = new static($from->getShortName());
7272
$class->type = $from->isInterface() ? 'interface' : (PHP_VERSION_ID >= 50400 && $from->isTrait() ? 'trait' : 'class');
73-
$class->final = $from->isFinal();
73+
$class->final = $from->isFinal() && $class->type === 'class';
7474
$class->abstract = $from->isAbstract() && $class->type === 'class';
7575
$class->implements = $from->getInterfaceNames();
7676
$class->documents = preg_replace('#^\s*\* ?#m', '', trim($from->getDocComment(), "/* \r\n\t"));

0 commit comments

Comments
 (0)