What does @internal mean and how to use it?

What does the @internal tag @internal when used in PHPDocs and how does it work? I read the documentation for this tag and got this definition.

The @internal tag is used to indicate that related structural elements are internal to this application or library. It can also be used in a long description to insert a piece of text that is applicable only to developers of this software.

I understand the essence of this, but I do not understand how I could use it in a project? I read this example, and I understand that the function designated as @internal means that it is intended to be used as part of the software and should not be used by anything external. For example, in a PHP library, if a function is marked as @internal , it is not part of the public API provided by the library.

My questions:

  • Do I understand @internal ? If not, what is the correct use?
  • If my understanding is correct, why does PhpStorm cross out my @internal functions, implying that they are not intended to be used? How to use the function marked as @internal ?
+7
phpstorm phpdoc
source share
1 answer

It may seem trivial for some, but it's good to note that declaring a private function, if possible, is probably better than using @internal .

This is not to say that there are no valid uses for this tag, but it is always useful to choose your design if you want to use it.

0
source share

All Articles