Skip to content

Commit 180776d

Browse files
authored
Fix tool annotation type error when using custom Attributes (#75)
* Fix tool annotation type error when using custom Attributes * Use instanceof
1 parent 67513dc commit 180776d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Server/Tool.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function annotations(): array
2929
// @phpstan-ignore-next-line
3030
return collect($reflection->getAttributes())
3131
->map(fn (ReflectionAttribute $attributeReflection): object => $attributeReflection->newInstance())
32+
->filter(fn (object $attribute): bool => $attribute instanceof Annotation)
3233
// @phpstan-ignore-next-line
3334
->mapWithKeys(fn (Annotation $attribute): array => [$attribute->key() => $attribute->value])
3435
->all();

0 commit comments

Comments
 (0)