Open eralumin opened 5 years ago
I think all tags that are not included in this list should be ignored.
Several code bases use custom tags, so limiting to the ones that phpdoc supports would stop reporting errors for all custom tags, which would be a big regression.
I'm not really sure what to do here as I don't see how PHPCS can tell that this is sample code and not a list of documentation tags. Open to ideas.
I think the correct indentation should be
/**
* @SWG\Definition(
* definition="error",
* required={"success", "data"},
* @SWG\Xml(name="error"),
* @SWG\Property(
* property="success",
* format="boolean",
* description="Example",
* example=false,
* default=false
* ),
* @SWG\Property(
* property="data",
* format="object",
* required={"message", "code"},
* @SWG\Property(property="message", format="string", example=400),
* @SWG\Property(property="code", format="int32")
* )
* )
*/
@gsherwood If there is a way to detect nested tag and how deep they are nested, it solve the problem. These tags are sort of scope openers.
Hi,
I use zircote/swagger-php for a project, and i notice that PHP Code Sniffer raise
Expected 1 space after asterisk; x found
error for each line of comment blocks that start with*[2 or more space]@SWG\
.Example of comment blocks that don't raise error with PHP Code Sniffer:
Example of comment blocks that raise error with PHP Code Sniffer:
Linter Result:
I think all tags that are not included in this list should be ignored.