Purpose of @var declaration at top of default block snippets?

This might be a newbie question, but I couldn’t find an answer:

What is the purpose of the @var ... line of php code at the top of the default block snippets?

E.g. from the docs of the text block:

<?php /** @var \Kirby\Cms\Block $block */ ?>
<?= $block->text();

(I’m getting started with customizing existing and creating custom block types for some projects, so I’d like to understand blocks in Kirby as best as possible.)

Tells your IDE what the variable is to enable code completion.

1 Like

Thank you :slight_smile: