Skip to content

Commit dca9810

Browse files
committed
! Fixed assertion
1 parent d0135c9 commit dca9810

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Builder/DocComment.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616

1717
use function assert;
1818
use Exception;
19+
use function get_class;
1920
use Maslosoft\Addendum\Reflection\ReflectionAnnotatedClass;
21+
use Maslosoft\Addendum\Reflection\ReflectionFile;
2022
use Maslosoft\Addendum\Utilities\ClassChecker;
2123
use Maslosoft\Addendum\Utilities\NameNormalizer;
2224
use ReflectionClass;
@@ -96,7 +98,7 @@ public function forFile($name, $className = null)
9698

9799
public function forClass(Reflector $reflection)
98100
{
99-
assert($reflection instanceof ReflectionClass);
101+
assert($reflection instanceof ReflectionClass || $reflection instanceof ReflectionFile, sprintf("Expected `%s` or `%s`, got `%s`", ReflectionClass::class, ReflectionFile::class, get_class($reflection)));
100102
if (ClassChecker::isAnonymous($reflection->name))
101103
{
102104
echo '';

0 commit comments

Comments
 (0)