docblockr icon indicating copy to clipboard operation
docblockr copied to clipboard

PHP @method misuse

Open Arcesilas opened this issue 7 years ago • 2 comments

PHP docblocks for methods always contain an @method tag: this is a misuse of this tag, according to https://docs.phpdoc.org/references/phpdoc/tags/method.html

@method tags MUST NOT be used in a PHPDoc that is not associated with a class or interface.

Or maybe this package is for another phpdoc generator?

Could it be removed from template? Or is there a way to customize the templates?

Arcesilas avatar Jan 21 '18 12:01 Arcesilas

The @method shouldn't be there. I can't reproduce this. Could it be that you added @method in the extra_tags configuration?

MoritzKn avatar May 23 '18 20:05 MoritzKn

@Arcesilas I had the same question and when I looked into the source for the DocsParser.prototype.format_function function definition, I noticed that there's this code at line 140:

    if (this.editor_settings.auto_add_method_tag) {
        out.push('@method '+ escape(name));
    }

I checked my Docblockr package settings in Atom and sure enough the tick box was checked. Unchecking this solved my issue. Not sure if it'll be the same for you, but might also explain why @MoritzKn couldn't reproduce this behaviour.

rabrowne85 avatar May 12 '19 20:05 rabrowne85