Allow no comment for a constructor where needed #440
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While working on magento/magento2#37020, I noticed that the Magento coding standard was requiring a docblock comment for the following constructor:
https://github.com/magento/magento2/blob/322047d01d98b584892c6058ed93c5bf6715add8/lib/internal/Magento/Framework/Data/Tree.php#L28-L33
Typically there is no 'short description' required for constructors, but a docblock listing each
@param
is required (even if it's purely a duplicate of what PHP says, but that's a separate issue/gripe). However, as this particular constructor does not have any parameters, I consider the requirement for a docblock an error.This pull request adds a special case for the
__construct()
method to avoid a useless (or empty) comment being added.