magento / magento-coding-standard

Magento Coding Standard
Open Software License 3.0
349 stars 153 forks source link

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

Open aligent-lturner opened 2 years ago

aligent-lturner commented 2 years ago

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 (https://github.com/AdobeDocs/commerce-php/issues/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 commented 2 years ago

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
torhoehn commented 2 years ago

@sivaschenko Would it be possible to merge this please?

aligent-lturner commented 1 year ago

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

@ihor-sviziev conflict has been resolved

sinhaparul commented 1 year ago

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

m2-github-services commented 1 year ago

@sinhaparul the Pull Request is successfully imported.

fredden commented 11 months ago

See also #476

ihor-sviziev commented 11 months ago

@sinhaparul @sidolov could you please merge it?

aligent-lturner commented 1 month ago

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