magento-coding-standard icon indicating copy to clipboard operation
magento-coding-standard copied to clipboard

Class properties that have types should not require a DocBlock

Open aligent-lturner opened this issue 2 years ago • 7 comments

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 avatar Jun 24 '22 01:06 aligent-lturner

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

aligent-lturner avatar Jun 24 '22 01:06 aligent-lturner

@sivaschenko Would it be possible to merge this please?

torhoehn avatar Sep 09 '22 08:09 torhoehn

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

@ihor-sviziev conflict has been resolved

aligent-lturner avatar Apr 11 '23 23:04 aligent-lturner

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

sinhaparul avatar Jun 05 '23 20:06 sinhaparul

@sinhaparul the Pull Request is successfully imported.

m2-github-services avatar Jun 05 '23 20:06 m2-github-services

See also #476

fredden avatar Dec 18 '23 08:12 fredden

@sinhaparul @sidolov could you please merge it?

ihor-sviziev avatar Dec 18 '23 09:12 ihor-sviziev