What is the meaning of redundant docblock php tags like @static?

When using php docblock auto-generation in PhpStorm, I ended up annotating @staticusing the static method:

/**
 * Reset the singleton instance, for the tests only
 * @static
 */
public static function reset() {
    self::$singletonInstance = null;
}

Can these tags be used if they can be inferred from code? I am trying to decide whether I leave it or delete it (and do it everywhere so that it is consistent).

+5
source share
1 answer

These tags were introduced for legacy PHP 4 code, which did not allow the use of such keywords in the code. With PHP 5, the code is really self-documenting, so these tags are really redundant; I see no reason to keep them around.

, - PHP 5, phpDocumentor , . phpDocumentor:

static , PhpDocumentor PHP5 , PhpDocumentor .

+6

All Articles