Skip to content

Fix Comment block is missing Failure when Attribute is present after the docblock #335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

karyna-t
Copy link
Contributor

The Warning 'Comment block is missing' is thrown when the attribute is present after the docblock.

example:

/**
 * Check if given type is any type.
 *
 * @param string $type
 * @return bool
 */
#[\ReturnTypeWillChange]
public function isTypeAny($type)

In such case our Sniff should ignore the attribute.

Copy link
Member

@sivaschenko sivaschenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @karyna-tsymbal-atwix ! Please see my comment.

Also, please add several different cases with valid and invalid phpdoc to the unit tests

Copy link
Contributor Author

@karyna-t karyna-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

andrewbess
andrewbess previously approved these changes Nov 19, 2021
Copy link
Contributor

@andrewbess andrewbess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @karyna-tsymbal-atwix
Thank you for your contribution here
Approved ✔️

@karyna-t
Copy link
Contributor Author

@sivaschenko thanks for the review! I've added couple test cases, please check.

@sivaschenko
Copy link
Member

@magento import pr to magento-commerce/magento-coding-standard

@m2-github-services
Copy link
Contributor

@sivaschenko the Pull Request is successfully imported.

@karyna-t
Copy link
Contributor Author

karyna-t commented Nov 23, 2021

This PR contains changens according to magento/magento2#34679

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants