Inline class annotation with /** @var or just comments? I found in some drupal commerce modules class comments in way I haven't seen so far

/** @var \Drupal\commerce_payment\Entity\PaymentInterface $payment */
$payment = $this-&gt;entity;
/** @var \Drupal\commerce_paypal\Plugin\Commerce\PaymentGateway\ExpressCheckoutInterface $payment_gateway_plugin */
$payment_gateway_plugin = $payment-&gt;getPaymentGateway()-&gt;getPlugin();


I am not sure what to google to get to know more about this, why was it used like that and is this annotation or just plan comment?
I checked more about annotations and it doesnt makes sense to have them in places other then outside the class, as stated on d.org, so this is just plain comment for IDE's to connect what is used there.


  In addition, there is a performance bonus as it makes Drupal use less
  memory when discovering plugins. The original implementation had a
  getInfo() method on each class, similar to Drupal 7 test classes. This
  meant each class had to be loaded into memory to get its information
  and the memory was not freed until the end of the request, thus
  greatly increasing the peak memory requirement for PHP. Instead, the
  implementation used by Drupal to parse the annotation simply tokenizes
  the text of the file without including it as a PHP file, so memory use
  is minimized.