Skip to content
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

Class properties that have types should not require a DocBlock #406

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

aligent-lturner
Copy link

Fixes #404

If a class property has a type, then there should not be a requirement for a DocBlock.
A DocBlock can still be added if desired - this change simply removes the warning for a missing comment block when the property has a defined type.

Note - this does not validate that the type is valid, only that it is not specifically invalid in the same way as https://github.com/magento/magento-coding-standard/blob/develop/Magento2/Sniffs/Annotation/MethodArgumentsSniff.php

Additional: This issue was originally raised against the documentation page (AdobeDocs/commerce-php#23), and was suggested to be raised directly here. The documentation would need to be updated to reflect that DocBlocks are only required for properties without a type.

@aligent-lturner
Copy link
Author

Failing tests do not appear to be related to this change, but a missing Symfony class:

Error: Class "Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator" not found

Co-authored-by: Ihor Sviziev <[email protected]>
@torhoehn
Copy link

torhoehn commented Sep 9, 2022

@sivaschenko Would it be possible to merge this please?

Copy link
Collaborator

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

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

hi @aligent-lturner,
Could you please resolve conflicts?

…s_properties

# Conflicts:
#	Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc
@aligent-lturner
Copy link
Author

hi @aligent-lturner, Could you please resolve conflicts?

@ihor-sviziev conflict has been resolved

ihor-sviziev
ihor-sviziev previously approved these changes Apr 12, 2023
@sinhaparul
Copy link
Contributor

@magento import PR to magento-commerce/magento-coding-standard repository

@m2-github-services
Copy link
Contributor

@sinhaparul the Pull Request is successfully imported.

@fredden
Copy link
Member

fredden commented Dec 18, 2023

See also #476

@ihor-sviziev
Copy link
Collaborator

@sinhaparul @sidolov could you please merge it?

@aligent-lturner
Copy link
Author

@sidolov this has been approved for almost a year now. Any chance it can be merged soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Reviewer Approved
Development

Successfully merging this pull request may close these issues.

Do not require DocBlock for typed class attributes
6 participants